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

fix auth tests for RHOAI #1700

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

StevenTobin
Copy link
Contributor

Description

e2e failures in #1674 seem to be caused by the function for returning the adminGroup getting an empty platform and returning the wrong group. Fix this by setting the group in the test.

How Has This Been Tested?

Screenshot or short clip

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@openshift-ci openshift-ci bot requested review from ykaliuta and zdtsw February 26, 2025 12:29
Copy link

openshift-ci bot commented Feb 26, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from steventobin. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 22.18%. Comparing base (2c5e52a) to head (6e57ef1).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1700      +/-   ##
==========================================
+ Coverage   22.15%   22.18%   +0.03%     
==========================================
  Files         165      168       +3     
  Lines       11302    11384      +82     
==========================================
+ Hits         2504     2526      +22     
- Misses       8542     8600      +58     
- Partials      256      258       +2     

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

Comment on lines +103 to 107
if tc.platform == cluster.SelfManagedRhoai || tc.platform == cluster.ManagedRhoai {
return fmt.Errorf("expected rhods-admins, found %v", tc.testAuthInstance.Spec.AdminGroups[0])
} else if tc.testAuthInstance.Spec.AdminGroups[0] != "odh-admins" {
return fmt.Errorf("expected odh-admins, found %v", tc.testAuthInstance.Spec.AdminGroups[0])
}
Copy link
Member

Choose a reason for hiding this comment

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

i am not sure i understand this change:
so this is to test if the platform is for self-managed or managed, and error out?
but the test should not care about this,
instead (simiar to validateRemovingGroups):

  • if platform is cluter.OpenDataHub || cluster.Unknown=> odh-admins as AdminGroups[0]
  • if is SelfManaged => rhods-admins as AdminGroups[0]
  • if is Managed => dedicated-admins

@zdtsw zdtsw added the testing label Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants