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

test: add e2e tests for multi-tenancy [multi-tenancy PR 12] #1429

Merged
merged 31 commits into from
May 7, 2024

Conversation

binbin-li
Copy link
Collaborator

@binbin-li binbin-li commented Apr 30, 2024

Description

What this PR does / why we need it:

This is the 12th PR for multi-tenancy support. Check the diff between PR 11 and PR 12 at: binbin-li#145

  1. Added namespace to the logger values for easier debugging. e.g.
    image
  2. Added constraint templates for multi-tenancy scenarios and updated all references to CT in bats files. To use multi-tenancy in Ratify, constraint template should pass keys in format: [namespace]image-reference instead of single image-reference.
  3. Added a e2e test for using namespaced CRs to validate images.

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):

Fixes #

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Helm Chart Change (any edit/addition/update that is necessary for changes merged to the main branch)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • Does the affected code have corresponding tests?
  • Are the changes documented, not just with inline documentation, but also with conceptual documentation such as an overview of a new feature, or task-based documentation like a tutorial? Consider if this change should be announced on your project blog.
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have appropriate license header?

Post Merge Requirements

  • MAINTAINERS: manually trigger the "Publish Package" workflow after merging any PR that indicates Helm Chart Change

@binbin-li binbin-li marked this pull request as draft April 30, 2024 13:53
@binbin-li binbin-li force-pushed the multi-tenancy-pr-12 branch from 65dbb3a to 26f45c9 Compare April 30, 2024 13:55
Copy link

codecov bot commented Apr 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.74%. Comparing base (1bd347c) to head (9223d64).
Report is 8 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1429      +/-   ##
==========================================
- Coverage   66.76%   66.74%   -0.03%     
==========================================
  Files         116      119       +3     
  Lines        6030     6134     +104     
==========================================
+ Hits         4026     4094      +68     
- Misses       1620     1659      +39     
+ Partials      384      381       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@binbin-li binbin-li force-pushed the multi-tenancy-pr-12 branch 4 times, most recently from cf0ed11 to c459710 Compare April 30, 2024 16:08
@binbin-li binbin-li force-pushed the multi-tenancy-pr-12 branch 3 times, most recently from 830c01d to f0f77f7 Compare May 1, 2024 12:07
@binbin-li binbin-li changed the title [WIP] test: add e2e tests for multi-tenancy test: add e2e tests for multi-tenancy [multi-tenancy PR 12] May 1, 2024
@binbin-li binbin-li force-pushed the multi-tenancy-pr-12 branch from f0f77f7 to 1d73209 Compare May 1, 2024 12:37
@binbin-li binbin-li marked this pull request as ready for review May 1, 2024 14:18
@binbin-li binbin-li force-pushed the multi-tenancy-pr-12 branch from 1d73209 to a6d87b7 Compare May 2, 2024 12:17
@binbin-li binbin-li force-pushed the multi-tenancy-pr-12 branch from a6d87b7 to 170a078 Compare May 3, 2024 14:38
@binbin-li binbin-li force-pushed the multi-tenancy-pr-12 branch from 170a078 to f0df760 Compare May 4, 2024 00:16
@akashsinghal
Copy link
Collaborator

@binbin-li cross posting discussion we were having in your fork's PR. Left another comment: https://github.com/binbin-li/ratify/pull/145/files#r1589761430

@binbin-li
Copy link
Collaborator Author

@binbin-li cross posting discussion we were having in your fork's PR. Left another comment: https://github.com/binbin-li/ratify/pull/145/files#r1589761430

Following on the main PR. That's valid concern on the test failure. I'll add the basic test case covering the multi-tenancy scenario. Thanks for calling it out!

@binbin-li binbin-li force-pushed the multi-tenancy-pr-12 branch from 4726003 to 2b6c557 Compare May 6, 2024 05:51
@binbin-li
Copy link
Collaborator Author

@binbin-li cross posting discussion we were having in your fork's PR. Left another comment: https://github.com/binbin-li/ratify/pull/145/files#r1589761430

Following on the main PR. That's valid concern on the test failure. I'll add the basic test case covering the multi-tenancy scenario. Thanks for calling it out!

Added a test covering notation and cosign verifiers which will cover both cert/key fetching in KMP. And we run the validation for notation and cosign separately which could avoid the testing failure.

Copy link
Collaborator

@akashsinghal akashsinghal left a comment

Choose a reason for hiding this comment

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

Thanks for the updates. lgtm

@akashsinghal
Copy link
Collaborator

@binbin-li Side question: What is the guidance moving forward when we need to add e2e tests. Do we target clustered or namespaced scenarios or do we have to do both?

@binbin-li
Copy link
Collaborator Author

@binbin-li Side question: What is the guidance moving forward when we need to add e2e tests. Do we target clustered or namespaced scenarios or do we have to do both?

good question. I think we can keep focusing on cluster-wide scenarios. But if the change involves multi-tenancy or namespace, then we should add or update namespaced tests.

@binbin-li binbin-li merged commit 4b2f556 into ratify-project:dev May 7, 2024
17 checks passed
akashsinghal pushed a commit to akashsinghal/ratify that referenced this pull request Sep 13, 2024
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