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

ROX-14528: Add OCM mock client #761

Merged
merged 1 commit into from
Feb 1, 2023
Merged

ROX-14528: Add OCM mock client #761

merged 1 commit into from
Feb 1, 2023

Conversation

stehessel
Copy link
Contributor

@stehessel stehessel commented Jan 24, 2023

Description

Build a mocked OCM client if ocmConfig.MockEnable=true. Change to the mocked OCM client as default for the development environment. The purpose of this change is enabling development without needing access to a real OCM service account.

It seems some of the integration tests currently rely on the default being OCM_ENV=development, which up to now set ocmConfig.MockEnable=false. To compensate, integration tests now explicitly disable the OCM mock.

The mocked OCM client returns a stubbed organisation upon request. It does not handle quota related endpoints, so it does not yet work in combination with --quota-type=ams. For this, more OCM endpoints would need to be stubbed in the mocked client.

Supersedes #758

Checklist (Definition of Done)

  • Unit and integration tests added
  • Added test description under Test manual
  • Evaluated and added CHANGELOG.md entry if required
  • Documentation added if necessary (i.e. changes to dev setup, test execution, ...)
  • CI and all relevant tests are passing
  • Add the ticket number to the PR title if available, i.e. ROX-12345: ...
  • Discussed security and business related topics privately. Will move any security and business related topics that arise to private communication channel.

Test manual

Verified that local execution without ocm service account credentials works.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 24, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@stehessel stehessel temporarily deployed to development January 24, 2023 20:03 — with GitHub Actions Inactive
@stehessel stehessel temporarily deployed to development January 24, 2023 23:49 — with GitHub Actions Inactive
@stehessel stehessel temporarily deployed to development January 25, 2023 00:22 — with GitHub Actions Inactive
@stehessel stehessel requested review from a team, SimonBaeumer and vladbologa January 30, 2023 12:10
@stehessel stehessel marked this pull request as ready for review January 30, 2023 12:10
@stehessel stehessel temporarily deployed to development January 30, 2023 12:30 — with GitHub Actions Inactive
Copy link
Member

@SimonBaeumer SimonBaeumer left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

Copy link
Contributor

@vladbologa vladbologa left a comment

Choose a reason for hiding this comment

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

Tested it in my local env and it works, thanks!

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 31, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SimonBaeumer, stehessel, vladbologa

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [SimonBaeumer,vladbologa]

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

@stehessel stehessel merged commit d2b3814 into main Feb 1, 2023
@stehessel stehessel deleted the ROX-14528/ocm-mock branch February 1, 2023 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants