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

Tests: Skip OPS-based integration tests when no credentials are defined #86

Merged
merged 2 commits into from
Jan 28, 2024

Conversation

amotl
Copy link
Member

@amotl amotl commented Jan 28, 2024

Problem

GH-81 demonstrated that the software tests run on behalf of GHA fail on external contributions, because they do not have access to the OPS credentials per GitHub Actions Secrets. Bummer.

Solution

This patch will make running OPS-based tests optional. That this decreases the coverage of the code base, is unfortunate, but at least, tests will stop failing on CI. C'est la vie.

Outlook

A possible solution for a subsequent iteration would be to emulate/mock a OPS service backend, so integration tests could be synthesized. I think @gsong may have used such a technique on a previous version?

Copy link

codecov bot commented Jan 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a024610) 99.53% compared to head (8a3f3c4) 99.53%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #86   +/-   ##
=======================================
  Coverage   99.53%   99.53%           
=======================================
  Files          18       18           
  Lines         428      428           
=======================================
  Hits          426      426           
  Misses          2        2           
Flag Coverage Δ
unittests 99.53% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@amotl amotl marked this pull request as ready for review January 28, 2024 10:55
@amotl amotl changed the title Tests: Modernize configuration and invocation of pytest Tests: Unlock running the test suite without OPS credentials Jan 28, 2024
@amotl amotl changed the title Tests: Unlock running the test suite without OPS credentials Tests: Skip OPS-based tests when no credentials are defined Jan 28, 2024
While it will only cover parts of the test suite, which is unfortunate,
at least it will not break. This is relevant for CI/GHA, because pull
requests submitted by external contributors do not have access to the
OPS credentials per GitHub Actions Secrets. C'est la vie.
By centralizing common configuration settings into `pyproject.toml`,
the invocation is more universal, and the configuration does not need to
be maintained at different spots.
@amotl amotl changed the title Tests: Skip OPS-based tests when no credentials are defined Tests: Skip OPS-based integration tests when no credentials are defined Jan 28, 2024
@amotl
Copy link
Member Author

amotl commented Jan 28, 2024

Hi @gsong. I am not sure if you are into reviewing my boring maintenance patches, or not. Occasionally, I let the PR open for a while to give you the chance to review it, but if you think it isn't necessary, I will adjust my workflow to always merge them right away if I consider them not too critical / if they do not touch the code base at all.

@amotl amotl mentioned this pull request Jan 28, 2024
@gsong
Copy link
Member

gsong commented Jan 28, 2024

Hi @gsong. I am not sure if you are into reviewing my boring maintenance patches, or not. Occasionally, I let the PR open for a while to give you the chance to review it, but if you think it isn't necessary, I will adjust my workflow to always merge them right away if I consider them not too critical / if they do not touch the code base at all.

Not boring at all! I really appreciate your stewardship of this tool. Feel free to open PR and @mention me or mark me as reviewer. But no need to wait for me to merge stuff. I would like to keep up to date as much as possible, but probably like you, that time comes in spurts.

@amotl amotl merged commit 6f058d7 into main Jan 28, 2024
4 checks passed
@amotl amotl deleted the amo/improve-ci branch January 28, 2024 17:41
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