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 a test that relies on Prom library #2432

Merged
merged 1 commit into from Jan 17, 2024
Merged

Conversation

michaelmdresser
Copy link
Contributor

What does this PR change?

We were assuming that the library always returns seconds, but it can now also return minutes (presumably if the seconds divide well). This is probably failing due to an update of that library.

How will this PR impact users?

  • N/A

How was this PR tested?

  • Unit test was failing for me, now passes

Copy link

vercel bot commented Jan 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
opencost ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 17, 2024 0:16am

expDurSecStr := fmt.Sprintf("%ds", expDurSec)
expDurMin := int(now.Sub(startOfToday).Minutes())
expDurMinStr := fmt.Sprintf("%dm", expDurMin)
if dur != expDurSecStr {
Copy link
Contributor

Choose a reason for hiding this comment

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

super nit: any particular reason to not AND the two conditions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No good reason at all -- fixed, thanks!

We were assuming that the library always returns seconds, but it can
now also return minutes (presumably if the seconds divide well). This is
probably failing due to an update of that library.

Signed-off-by: Michael Dresser <michaelmdresser@gmail.com>
Copy link

sonarcloud bot commented Jan 17, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@michaelmdresser michaelmdresser merged commit 245fbc8 into develop Jan 17, 2024
6 checks passed
@michaelmdresser michaelmdresser deleted the mmd/fix-window-test branch January 17, 2024 00:20
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.

None yet

3 participants