Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Fix missing licences test #53

Merged
merged 7 commits into from
Aug 1, 2024
Merged

Conversation

mcucchi9
Copy link
Contributor

@mcucchi9 mcucchi9 commented Jul 24, 2024

This PR, initially motivated by a fix required to the test_collection_missing_licence test due to development in ecmwf-projects/cads-processing-api-service#194, implements the following:

  • Updates conftest.py so that the test user api key is not written in the code, but is instead taken from a CADS_TEST_KEY env variable (@Trik16 to be added to the secrets). If the env variable is not defined, all (now few) tests relying on it are skipped;
  • Switch most of the tests to using the Anonymous user api key instead of the test user's one;
  • Add a test for the presence of a message field in the response to the process submission request by the Anonymous user.

Needs

Copy link
Member

@malmans2 malmans2 left a comment

Choose a reason for hiding this comment

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

All good! I think we need to change the key shown in the README though

@@ -49,30 +49,29 @@ def test_validate_constraints(api_root_url: str) -> None:


def test_collection_missing_licence(
api_root_url: str, api_key_anon: str, request_year: str
api_root_url: str, api_key_test: str, request_year: str
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
api_root_url: str, api_key_test: str, request_year: str
api_root_url: str, api_key_anon: str, request_year: str

@malmans2 malmans2 merged commit 4bd31d5 into main Aug 1, 2024
12 checks passed
@malmans2 malmans2 deleted the COPDS-1842-fix-missing-licences-test branch August 1, 2024 10:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants