Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add cli test #38

Merged
merged 6 commits into from
Mar 8, 2023
Merged

Feature/add cli test #38

merged 6 commits into from
Mar 8, 2023

Conversation

jmkerloch
Copy link
Contributor

@jmkerloch jmkerloch commented Feb 20, 2023

related #31
related #15

r2gg package

  • update ArgumentParser for parse_args() use (needed so we can mock ArgumentParser in test)

test data

  • use tests data from IGN storage

tests

  • add unit test documentation with docker-compose use and command for test execution in r2gg docker image
  • add tests/dev/docker-compose.dev.yml for postgis test database
  • add pytest configuration in setup.cfg
  • add tests configuration files for pivot database creation :
    • database definition tests/config/bdtopo_base.json and tests/config/pivot_base.json
    • r2gg configuration for pivot database creation : tests/config/sql2pivot.json
    • to be able to use these files in CI and in r2gg docker image, {src_dir} value in .json configuration file is replaced with current source directory
  • add cli test tests/test_cli.py with pytest:
    • define pytest fixture to init input database with bdtopo sample from marseille 10eme arrondissement .sql dumps
    • mock ArgumentParser to define used configuration file

@jmkerloch jmkerloch self-assigned this Feb 20, 2023
@github-actions
Copy link

github-actions bot commented Feb 22, 2023

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1016 205 20% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
r2gg/_configure.py 95% 🟢
TOTAL 95% 🟢

updated for commit: cd9310b by action🐍

@jmkerloch jmkerloch force-pushed the feature/add_cli_test branch 5 times, most recently from ac47c32 to 86f7fed Compare February 22, 2023 15:00
@jmkerloch jmkerloch marked this pull request as ready for review February 22, 2023 15:03
@jmkerloch jmkerloch requested a review from a team February 22, 2023 15:04
@jmkerloch jmkerloch added CI Related to Continuous Integration test Related to test labels Feb 22, 2023
@jmkerloch jmkerloch added this to the sprint2 milestone Feb 22, 2023
@jmkerloch jmkerloch linked an issue Feb 22, 2023 that may be closed by this pull request
9 tasks
@jmkerloch jmkerloch removed a link to an issue Feb 22, 2023
9 tasks
Guts
Guts previously approved these changes Feb 23, 2023
Copy link
Collaborator

@Guts Guts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quelques remarques mais dans l'ensemble c'est un super travail qui va impacter l'ensemble du projet !

.github/workflows/unit-test.yml Show resolved Hide resolved
docs/development/testing.md Outdated Show resolved Hide resolved
docs/development/testing.md Outdated Show resolved Hide resolved
tests/test_cli.py Show resolved Hide resolved
tests/test_cli.py Outdated Show resolved Hide resolved
@lgrd
Copy link
Collaborator

lgrd commented Feb 28, 2023

@jmkerloch
Copy link
Contributor Author

@lgrd I updated the test to use URLs instead of .sql in the repository.

jmkerloch and others added 5 commits February 28, 2023 17:07
feat(test): add replace of {src_dir} in input .json file

feat(test): use {src_dir} to define path to bdtopo .sql conversion file

feat(test): update postgis service name

fix(test): insert data in ign database instead of pivot database

feat(test): refactor and remove update_database_json_host function

feat(test): refactor sqlconvert to cli name sql2pivot

feat(test): refactor to drop input dumps after test and add patch in test function
feat(test): test with 172.17.0.1 postgres host

feat(test): call pytest with python

feat(test): test with GitHub action for coverage
@jmkerloch jmkerloch linked an issue Mar 1, 2023 that may be closed by this pull request
@jmkerloch jmkerloch removed this from the sprint2 milestone Mar 1, 2023
@jmkerloch jmkerloch added this to the sprint3 milestone Mar 1, 2023
Copy link
Collaborator

@lgrd lgrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, very good ! Thanks for the doc which is very clear. :) I've tested it and it worked so let's go ! ;)

@jmkerloch jmkerloch merged commit 8fbf39a into develop Mar 8, 2023
@jmkerloch jmkerloch deleted the feature/add_cli_test branch March 8, 2023 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Related to Continuous Integration test Related to test
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

add data for end to end test of pivot base creation
4 participants