Skip to content

Abdk/multi platform detection v10#117861

Open
Abdkhan14 wants to merge 2 commits into
abdk/multi-platform-detection-v9from
abdk/multi-platform-detection-v10
Open

Abdk/multi platform detection v10#117861
Abdkhan14 wants to merge 2 commits into
abdk/multi-platform-detection-v9from
abdk/multi-platform-detection-v10

Conversation

@Abdkhan14

Copy link
Copy Markdown
Contributor

Adds unit and integration tests for the previously untested parts of multi_platform_detection.py, and cleans up minor quality issues in the existing test suite.

New test coverage:

TestSelectActivePlatforms — MAX_LANGUAGES cap, language grouping (TypeScript + JavaScript → one javascript slot), IGNORED_LANGUAGES skipped, byte-count descending ordering
TestPathIsIgnored — segment-vs-substring correctness (e.g. build.gradle is not ignored even though build/ is an ignored directory)
TestGetTree — defensive parsing of non-dict responses, missing tree key, truncated flag propagation
TestDetectPlatformsMulti (extended) — existence-only Pass 1 high match with zero content reads, co-location false-positive prevention end-to-end, high confidence sorts before medium regardless of byte count
Test quality cleanup:

Replaced hardcoded "abcdef" / "packages/f/package.json" in the reads-cap test with MAX_CONTENT_READS-derived values via string.ascii_lowercase
Replaced the hardcoded 4-language dict in the languages-cap test with _distinct_platform_languages(), a shared module-level helper that derives n distinct-base-platform languages from GITHUB_LANGUAGE_TO_SENTRY_PLATFORM at runtime
Removed one duplicate test (test_max_languages_cap_end_to_end — already covered by the unit test in TestSelectActivePlatforms)
Removed one redundant test (test_match_content_honors_inline_ignorecase_flag — already proven by test_match_content_with_content_returns_parent_dir)
Test plan
pytest tests/sentry/integrations/github/test_multi_platform_detection.py — 63 passed

@Abdkhan14 Abdkhan14 requested review from a team as code owners June 16, 2026 21:09
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.

1 participant