- Mock storage and dev server
- Dummy storage data
- Functional tests for OriginNode and OriginConnection
Details
- Reviewers
anlambert - Group Reviewers
Reviewers - Commits
- rDGQL34095c065153: Add first set of functional tests
Diff Detail
- Repository
- rDGQL GraphQL API
- Branch
- origin-tests
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 29405 Build 45954: Phabricator diff pipeline on jenkins Jenkins console · Jenkins Build 45953: arc lint + arc unit
Event Timeline
Build has FAILED
Patch application report for D7817 (id=28228)
Rebasing onto e43cde0cb4...
Current branch diff-target is up to date.
Changes applied before test
commit 7de3ce4168829db5a27030cf6955813c5874daad Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed May 11 10:51:12 2022 +0200 Add first set of functional tests - Mock storage and dev server - Dummy storage data - Functional tests for OriginNode and OriginConnection
Link to build: https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/9/
See console output for more information: https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/9/console
Build has FAILED
Patch application report for D7817 (id=28230)
Rebasing onto e43cde0cb4...
Current branch diff-target is up to date.
Changes applied before test
commit 7dda8e52dcc58b3a1f1e5b0b9a5856cf5edc200b Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed May 11 10:51:12 2022 +0200 Add first set of functional tests - Mock storage and dev server - Dummy storage data - Functional tests for OriginNode and OriginConnection
Link to build: https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/10/
See console output for more information: https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/10/console
Build has FAILED
Patch application report for D7817 (id=28231)
Rebasing onto e43cde0cb4...
Current branch diff-target is up to date.
Changes applied before test
commit e5409ed13e12642dc9d2cc805c19933fd326ca75 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed May 11 10:51:12 2022 +0200 Add first set of functional tests - Mock storage and dev server - Dummy storage data - Functional tests for OriginNode and OriginConnection
Link to build: https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/11/
See console output for more information: https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/11/console
Build has FAILED
Patch application report for D7817 (id=28232)
Rebasing onto e43cde0cb4...
Current branch diff-target is up to date.
Changes applied before test
commit 780e0d7e834f07f4670b0248d188a9e4d619732b Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed May 11 10:51:12 2022 +0200 Add first set of functional tests - Mock storage and dev server - Dummy storage data - Functional tests for OriginNode and OriginConnection
Link to build: https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/12/
See console output for more information: https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/12/console
Build has FAILED
Patch application report for D7817 (id=28233)
Rebasing onto e43cde0cb4...
Current branch diff-target is up to date.
Changes applied before test
commit 6ed56b9b24c5279a7e7512ede416d8222268fbcc Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed May 11 10:51:12 2022 +0200 Add first set of functional tests - Mock storage and dev server - Dummy storage data - Functional tests for OriginNode and OriginConnection
Link to build: https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/13/
See console output for more information: https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/13/console
Build has FAILED
Patch application report for D7817 (id=28262)
Rebasing onto e43cde0cb4...
Current branch diff-target is up to date.
Changes applied before test
commit d664beb1949c5e052cff4399d5142458d5c55b11 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed May 11 10:51:12 2022 +0200 Add first set of functional tests - Mock storage and dev server - Dummy storage data - Functional tests for OriginNode and OriginConnection
Link to build: https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/14/
See console output for more information: https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/14/console
Build is green
Patch application report for D7817 (id=28303)
Rebasing onto 2736e5f3dd...
Current branch diff-target is up to date.
Changes applied before test
commit 93d8b83a48c65f6abec8942ecae53bb6df70fff3 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed May 11 10:51:12 2022 +0200 Add first set of functional tests - Mock storage and dummy flask app for tests - Separate config file for tests - Dummy storage data for origin type - Functional tests for OriginNode and OriginConnection
See https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/16/ for more details.
Build is green
Patch application report for D7817 (id=28304)
Rebasing onto 2736e5f3dd...
Current branch diff-target is up to date.
Changes applied before test
commit 39ea7626af89812dd317b50368c05709867e4650 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed May 11 10:51:12 2022 +0200 Add first set of functional tests - Mock storage and dummy flask app for tests - Separate config file for tests - Dummy storage data for origin type - Functional tests for OriginNode and OriginConnection
See https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/17/ for more details.
swh/graphql/server.py | ||
---|---|---|
78 | s/falsk/flask/ | |
78–96 | If this only used by test, you should move this code in conftest.py and wraps it in a session scope fixture. | |
swh/graphql/tests/conftest.py | ||
7 | You should not import stuffs from private modules, we already have some issues because of that in the past. | |
30 | Use pytest-mock instead, this should translate to: @pytest.fixture(scope="session") def storage(mocker): def mock_storage(*args, **kw): storage = get_swhstorage(cls="memory") populate_dummy_data(storage) return storage mocker.patch.object(app_server, "get_storage", mock_storage) | |
swh/graphql/tests/functional/test_origin.py | ||
9 | You can gain one indentation level by removing the class and writing only functions for the tests. Something like: def test_origin_connection_get(client): ... def test_origin_connection_get_filter_by_pattern(client): ... ... | |
swh/graphql/tests/functional/utils.py | ||
11 | If the status code is not 200 and there is some error message in the response, you should extract it and display it if the assertions fails. error_message = (extract it from response if available) assert response.status_code == 200, error_message |
swh/graphql/tests/conftest.py | ||
---|---|---|
30 | Ok got it, you were forced to proceed like this because of the session scope. I think you can use function scope fixture (the default) directly then, based on my This way you can directly use the monkeypatch fixture. |
swh/graphql/tests/conftest.py | ||
---|---|---|
30 | Removed this mock, setting the global variable directly from conftest. |
Build has FAILED
Patch application report for D7817 (id=28344)
Rebasing onto 2736e5f3dd...
Current branch diff-target is up to date.
Changes applied before test
commit 1e07b31877cea885c804548a49b6c4cd7a0848e6 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed May 11 10:51:12 2022 +0200 Add first set of functional tests - in-memory storage and dummy flask app for tests - Dummy storage data to test origin type - Functional tests for OriginNode and OriginConnection
Link to build: https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/18/
See console output for more information: https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/18/console
Build is green
Patch application report for D7817 (id=28345)
Rebasing onto 2736e5f3dd...
Current branch diff-target is up to date.
Changes applied before test
commit 34095c065153cd24d35be41c54fcc30d8f3d12a9 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed May 11 10:51:12 2022 +0200 Add first set of functional tests - in-memory storage and dummy flask app for tests - Dummy storage data to test origin type - Functional tests for OriginNode and OriginConnection
See https://jenkins.softwareheritage.org/job/DGQL/job/tests-on-diff/19/ for more details.