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

test: Ensure consistent order in AllowedOnly result #28

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Nov 27, 2024

Go maps do not guarantee iteration order, which can occassionally break tests for AllowedOnly

Run go test -coverprofile=coverage.out ./...
 task-runner-launcher/cmd/launcher coverage: 0.0% of statements
? task-runner-launcher/internal/errs [no test files]
 task-runner-launcher/internal/commands coverage: 0.0% of statements
 task-runner-launcher/internal/http coverage: 0.0% of statements
 task-runner-launcher/internal/config coverage: 0.0% of statements
--- FAIL: TestAllowedOnly (0.00s)
 --- FAIL: TestAllowedOnly/returns_only_allowed_env_vars (0.00s)
 env_test.go:64: AllowedOnly() = [ALLOWED2=value2 ALLOWED1=value1], want [ALLOWED1=value1 ALLOWED2=value2]
FAIL
coverage: 98.2% of statements
FAIL task-runner-launcher/internal/env 0.004s
 task-runner-launcher/internal/logs coverage: 0.0% of statements
 task-runner-launcher/internal/ws coverage: 0.0% of statements
 task-runner-launcher/internal/retry coverage: 0.0% of statements
FAIL

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@tomi tomi left a comment

Choose a reason for hiding this comment

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

🚀

@ivov ivov merged commit 7f319a3 into main Nov 27, 2024
2 checks passed
@ivov ivov deleted the test-ensure-consistent-comparisons branch November 27, 2024 09:52
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.

3 participants