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

chore: mark db-dependent tests as needing to run in integration #9041

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

jesse-amano-hpe
Copy link
Contributor

@jesse-amano-hpe jesse-amano-hpe commented Mar 22, 2024

Description

The definition of db.ResolveTestPostgres() is in a file marked with // +build integration and therefore files that reference it fail to compile when that file is ignored (e.g. when running make test).

The agent test does not directly access the DB, but it ends up spinning up some goroutine somewhere that attempts to use an uninitialized Bun() and panics (presumably, because there's no DB available to satisfy the initialization of The One Bun in time). When it's run as part of make test-intg instead, it passes.

These tests would always run with integration tests anyway, all this changes is that they're ignored if you're only running "unit tests" or some select subset of tests that need to ignore these files in order to compile correctly.

Test Plan

Automated tests still pass

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

@cla-bot cla-bot bot added the cla-signed label Mar 22, 2024
Copy link

netlify bot commented Mar 22, 2024

Deploy Preview for determined-ui canceled.

Name Link
🔨 Latest commit 2f2ba7a
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/65fd23e7ffba9e0008ccab7e

Copy link

codecov bot commented Mar 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.80%. Comparing base (e4bc377) to head (2f2ba7a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9041      +/-   ##
==========================================
- Coverage   47.80%   47.80%   -0.01%     
==========================================
  Files        1161     1161              
  Lines      143646   143646              
  Branches     2373     2373              
==========================================
- Hits        68673    68671       -2     
- Misses      74820    74822       +2     
  Partials      153      153              
Flag Coverage Δ
backend 42.93% <ø> (-0.02%) ⬇️
harness 63.85% <ø> (+<0.01%) ⬆️
web 40.90% <ø> (ø)

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

see 4 files with indirect coverage changes

@jesse-amano-hpe jesse-amano-hpe marked this pull request as ready for review March 22, 2024 14:25
@jesse-amano-hpe jesse-amano-hpe requested review from a team as code owners March 22, 2024 14:25
Copy link
Contributor

@amandavialva01 amandavialva01 left a comment

Choose a reason for hiding this comment

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

LGTM nice work, thanks for adding this so that we can still unit test locally!

Copy link
Contributor

@carolinaecalderon carolinaecalderon left a comment

Choose a reason for hiding this comment

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

LGTM

@jesse-amano-hpe jesse-amano-hpe merged commit 02da36f into main Mar 26, 2024
77 of 89 checks passed
@jesse-amano-hpe jesse-amano-hpe deleted the jta/nobody-asked branch March 26, 2024 06:58
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