(PTFE-3084) Improve tests coverage#210
Merged
matthiasL-scality merged 1 commit intomainfrom Mar 13, 2026
Merged
Conversation
d3be213 to
3f22a7b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a comprehensive and robust end-to-end test suite for the artifacts service, covering authentication, health checks, build copying, build listings, and build discovery endpoints. It establishes reusable test fixtures and helpers for efficient setup and teardown of S3 buckets, HTTP sessions with various authentication levels, and common test operations. Shared constants are centralized for consistency across tests. The suite ensures correctness and security of key API endpoints and behaviors.
Test infrastructure and fixtures:
conftest.pyto provide session-scoped and function-scoped pytest fixtures for S3 client setup, bucket management, HTTP sessions with different authentication levels, and common test operations (uploading files, finishing builds). Includes robust S3 health check and cleanup logic.constants.pyfile, promoting reuse and consistency across the test suite.Authentication and authorization coverage:
test_auth.pyto verify access control: tests that authenticated users, restricted users, bots, failing users, and unauthenticated requests are all handled correctly with appropriate HTTP status codes for uploads, downloads, and metadata operations.Endpoint-specific tests:
test_healthcheck.pyto validate that health check and nginx status endpoints respond as expected, including method restrictions and connection reporting.test_copy.pyto exercise the build copy endpoint, checking correct behavior for missing status files, duplicate copies, and cache/ingress scenarios.test_listing.pyto verify build and root listings, including pagination, format variations, and aggregation across buckets.test_find_build.pyto test "find latest build" endpoints (/last_success/,/last_failure/,/latest/), ensuring correct redirect and error behaviors for various build states and prefixes.