-
Notifications
You must be signed in to change notification settings - Fork 1k
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: GitHub tests emitting unexpected keepers = {} #4462
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
go install golang.org/x/tools/cmd/goimports@latest | ||
|
||
gobin="$(go env GOPATH)/bin" | ||
declare -r gobin | ||
|
||
declare -a files | ||
readarray -d '' files < <(find . -type f -name '*.go' ! -name 'mock_*' ! -path './vendor/*' ! -path '**/mocks/*' -print0) | ||
declare -r files | ||
|
||
output="$("${gobin}"/goimports -l "${files[@]}")" | ||
declare -r output | ||
|
||
if [[ -n "$output" ]]; then | ||
echo "These files had their 'import' changed - please fix them locally and push a fix" | ||
|
||
echo "$output" | ||
|
||
exit 1 | ||
fi |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,4 +1,3 @@ | ||||||||||||||||||||||||||||
resource "random_id" "dummy1" { | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this issue came from a provider version update, to keep the tests deterministic, what do you think of pinning the provider versions for each of these terraform random provider (and possibly other provider) tests? We can add it to
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree we should probably pin this, or at least worth a discussion. I'm fine making that a followup and merging this as-is, since unit tests being broken on main is causing downstream issues. |
||||||||||||||||||||||||||||
keepers = {} | ||||||||||||||||||||||||||||
byte_length = 1 | ||||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,4 +1,3 @@ | ||||||||||||||||||||||||
resource "random_id" "dummy2" { | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related https://github.com/runatlantis/atlantis/pull/4462/files#r1573148934
Suggested change
|
||||||||||||||||||||||||
keepers = {} | ||||||||||||||||||||||||
byte_length = 1 | ||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
resource "random_id" "dummy1" { | ||
keepers = {} | ||
byte_length = 1 | ||
} | ||
|
||
resource "random_id" "dummy2" { | ||
keepers = {} | ||
byte_length = 1 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
resource "random_id" "dummy" { | ||
keepers = {} | ||
byte_length = 1 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
resource "random_id" "dummy" { | ||
keepers = {} | ||
byte_length = 1 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
resource "random_id" "dummy1" { | ||
count = terraform.workspace == "ops" ? 1 : 0 | ||
|
||
keepers = {} | ||
byte_length = 1 | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future, we may be able to automate this via pre-commit-config