Skip to content

test: add E2E test for Mageia ecosystem mapping#2873

Open
herdiyana256 wants to merge 8 commits into
google:mainfrom
herdiyana256:feature/os-mageia-ecosystem-e2e-v2
Open

test: add E2E test for Mageia ecosystem mapping#2873
herdiyana256 wants to merge 8 commits into
google:mainfrom
herdiyana256:feature/os-mageia-ecosystem-e2e-v2

Conversation

@herdiyana256

Copy link
Copy Markdown
Contributor

Add end-to-end test for scanning Mageia 9 container images to verify that the Mageia ecosystem mapping (added in google/osv-scalibr#2199) is correctly exercised by osv-scanner.

Changes:

  • Add test-mageia-9.Dockerfile fixture based on mageia:9 (pinned to sha256:9f7cd063...) which contains bundled Python wheels with known PyPI vulnerabilities
  • Add TestCommand_OCIImage/Scanning_Mageia_9_image test case in command_test.go to scan the generated Mageia tarball
  • Add TestCommand_OCIImage_JSONFormat/scanning_mageia_9_image test case for JSON output format validation
  • Update snapshots and cassettes with successful scan results

This follows the same pattern as the AlmaLinux E2E test (#2870) as requested by @michaelkedar in google/osv-scalibr#2177.

Tested via: make test ACC=true SNAPS=true SHORT=false TestCommand_OCIImage/Scanning_Mageia_9_image passes successfully.

@herdiyana256

Copy link
Copy Markdown
Contributor Author

Hi @michaelkedar, this is the E2E test PR for Mageia as requested in osv-scalibr#2177. The osv-scalibr mapping is in #2199 and the E2E tests are here. Could you approve the workflows so CI can run? Happy to address any feedback. Thanks!

@herdiyana256 herdiyana256 changed the title cmd/osv-scanner: add E2E test for Mageia ecosystem mapping test(cmd/osv-scanner): add E2E test for Mageia ecosystem mapping Jun 26, 2026
@herdiyana256 herdiyana256 changed the title test(cmd/osv-scanner): add E2E test for Mageia ecosystem mapping test: add E2E test for Mageia ecosystem mapping Jun 26, 2026
@herdiyana256
herdiyana256 force-pushed the feature/os-mageia-ecosystem-e2e-v2 branch from ac4c721 to 8e627d3 Compare June 26, 2026 07:32
@herdiyana256

Copy link
Copy Markdown
Contributor Author

Hi @michaelkedar, just pushed a few additional fixes to address the CI failures:
Removed accidentally included AlmaLinux test code (belongs in #2870) Added missing Mageia cassette entries for the JSONFormat test Could you re-approve the workflows?

Thanks!

@herdiyana256

Copy link
Copy Markdown
Contributor Author

Hi @michaelkedar, following up on #2873 (Mageia E2E test). Could you approve the workflows so CI can run? Depends on #2199 landing first. Thanks! :)

@another-rex

Copy link
Copy Markdown
Collaborator

Seems like you need to update the snapshots for the magia base image, as we are correctly detecting it now.

Add end-to-end test for scanning Mageia 9 container images to verify
that the Mageia ecosystem mapping (added in google/osv-scalibr#2199)
is correctly exercised by osv-scanner.

Changes:
- Add test-mageia-9.Dockerfile fixture based on mageia:9
  (pinned to sha256:9f7cd063...) which contains bundled Python wheels
  with known PyPI vulnerabilities
- Add TestCommand_OCIImage/Scanning_Mageia_9_image test case in
  command_test.go to scan the generated Mageia tarball
- Add TestCommand_OCIImage_JSONFormat/scanning_mageia_9_image test case
  for JSON output format validation
- Update snapshots and cassettes with successful scan results

This follows the same pattern as the AlmaLinux E2E test (google#2870)
as requested by @michaelkedar in google/osv-scalibr#2177.

Tested via: make test ACC=true SNAPS=true SHORT=false
TestCommand_OCIImage/Scanning_Mageia_9_image passes successfully.
…e image

- Bump github.com/google/osv-scalibr to v0.4.6-0.20260713000915-500ad84f4ed1
  which includes the Mageia ecosystem mapping fix (google/osv-scalibr#2199)
- Update TestCommand_OCIImage_JSONFormat/scanning_mageia_9_image snapshot to
  reflect that the Mageia base image is now correctly detected (base_image_index
  updated, 'mageia' added to base_images list)
- Update TestCommand_OCIImage_JSONFormat cassette with new API interaction order

Fixes snapshot mismatch that caused CI failures on all platforms.
@herdiyana256
herdiyana256 force-pushed the feature/os-mageia-ecosystem-e2e-v2 branch from d5fa2fd to af567eb Compare July 13, 2026 12:45
@herdiyana256

Copy link
Copy Markdown
Contributor Author

Hi @another-rex, thanks for the feedback!

I've updated the PR to address the snapshot mismatch:

  • **Bumped ** to v0.4.6-0.20260713000915-500ad84f4ed1 (includes the Mageia ecosystem mapping from extractor/os/rpm: add Mageia ecosystem mapping osv-scalibr#2199)
  • Updated snapshot for TestCommand_OCIImage_JSONFormat/scanning_mageia_9_image: the Mageia base image is now correctly detected (base_image_index updated, "name": "mageia" added to base_images)
  • Updated cassette for the JSONFormat test
  • Rebased onto latest main

The Mageia base image is now properly identified in the scan output. All Mageia-related tests pass locally. CI should now be green.

@herdiyana256

Copy link
Copy Markdown
Contributor Author

Hi @another-rex, follow-up on this one snapshot/cassette updates from the last push address your feedback, all Mageia tests pass locally now.

Still needs a review approval plus workflow approval to unblock CI/CodeQL. Could you take a look?

Thanks!

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.

2 participants