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

🌱 avoid assumptions about versions in tests #4134

Merged
merged 2 commits into from
May 30, 2024

Conversation

raboof
Copy link
Contributor

@raboof raboof commented May 29, 2024

What kind of change does this PR introduce?

It makes the tests more resilient against differences in the environment in which scorecard is built.

What is the current behavior?

Tests assume they are ran in an environment where the application version is not known/set.

What is the new behavior (if this is a feature change)?**

Tests make no assumptions about version fields anymore

  • Tests for the changes have been added (for bug fixes/features)

Which issue(s) this PR fixes

NONE

Special notes for your reviewer

Does this PR introduce a user-facing change?

For user-facing changes, please add a concise, human-readable release note to
the release-note

(In particular, describe what changes users might need to make in their
application as a result of this pull request.)

NONE

@raboof raboof requested a review from a team as a code owner May 29, 2024 18:46
@raboof raboof requested review from justaugustus and raghavkaul and removed request for a team May 29, 2024 18:46
@raboof raboof temporarily deployed to integration-test May 29, 2024 18:46 — with GitHub Actions Inactive
@raboof raboof force-pushed the avoid-version-assumptions-in-tests branch from 8dd3b8d to 5609066 Compare May 29, 2024 18:49
@raboof raboof temporarily deployed to integration-test May 29, 2024 18:50 — with GitHub Actions Inactive
@raboof raboof force-pushed the avoid-version-assumptions-in-tests branch from 5609066 to fd89e2e Compare May 29, 2024 18:58
@raboof raboof temporarily deployed to integration-test May 29, 2024 18:58 — with GitHub Actions Inactive
Copy link

codecov bot commented May 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.05%. Comparing base (6815161) to head (fd89e2e).
Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4134      +/-   ##
==========================================
- Coverage   66.06%   60.05%   -6.02%     
==========================================
  Files         226      214      -12     
  Lines       16291    15527     -764     
==========================================
- Hits        10763     9325    -1438     
- Misses       4854     5511     +657     
- Partials      674      691      +17     

For example NixOS builds and tests scorecards in an environment that
sets the version, which would make this test fail as it currently
assumes the version is unset when running tests.

Signed-off-by: Arnout Engelen <arnout@bzzt.net>
Copy link
Member

@justaugustus justaugustus left a comment

Choose a reason for hiding this comment

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

Thanks @raboof!

@justaugustus justaugustus enabled auto-merge (squash) May 30, 2024 12:52
@justaugustus justaugustus merged commit 6b49140 into ossf:main May 30, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants