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

Added tests for new endpoints 2.0 files #2747

Closed
wants to merge 7 commits into from

Conversation

jonathan343
Copy link
Contributor

This PR includes new functional tests that validate the presence and content of new endpoint files such as endpoint-rule-set.json, endpoint-tests.json, and partitions.json.

Copy link
Contributor

@jonemo jonemo left a comment

Choose a reason for hiding this comment

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

This is great. I've been burned by tests getting skipped silently due to missing test data files and this will help with that, so 👍 from me!

Do we already have a test elsewhere that asserts that Session().get_available_services() returns more than zero services? If not, that may be worth adding. Otherwise a completely empty data directory would result in these test passing.

I left a few inline comments inline regarding consolidating repeated code.

tests/functional/test_model_completeness.py Outdated Show resolved Hide resolved
tests/functional/test_model_completeness.py Outdated Show resolved Hide resolved
tests/functional/test_model_completeness.py Outdated Show resolved Hide resolved
tests/functional/test_model_completeness.py Outdated Show resolved Hide resolved
tests/functional/test_model_completeness.py Outdated Show resolved Hide resolved
Copy link
Contributor

@nateprewitt nateprewitt left a comment

Choose a reason for hiding this comment

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

Great, looking good! A couple more minor comments and I think we're close to done.

tests/functional/test_model_completeness.py Outdated Show resolved Hide resolved
tests/functional/test_model_completeness.py Outdated Show resolved Hide resolved
Comment on lines +73 to +80
@pytest.mark.parametrize("service_name", AVAILABLE_SERVICES)
def test_all_endpoint_tests_exist(service_name):
"""Tests the existence of endpoint-tests-1.json for each service
and verifies that content is present."""
endpoint_tests_file = os.path.join(TEST_DATA_DIR, service_name, 'endpoint-tests-1.json')
with open(endpoint_tests_file) as f:
data = json.load(f)
assert len(data['testCases']) >= 1
Copy link
Contributor

Choose a reason for hiding this comment

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

This is now also covered in my branch (currently in WIP PR jonemo#1) together with all other tests that need to access the tests/functional/endpoint-rules folder.

@nateprewitt
Copy link
Contributor

Resolving, this ended up addressed in a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants