Skip to content

Commit edd505e

Browse files
committed
refactor: e2e test ensure conftest command to check conftest version is greater or equal to specific version
1 parent b6f3724 commit edd505e

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
test:
44
docker:
5-
- image: ghcr.io/runatlantis/testing-env:2022.11.17
5+
- image: ghcr.io/runatlantis/testing-env:2022.12.17
66
steps:
77
- checkout
88
- run: make check-fmt

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
if: github.event.pull_request.draft == false
2828
name: runner / gotest
2929
runs-on: ubuntu-22.04
30-
container: ghcr.io/runatlantis/testing-env:2022.11.17
30+
container: ghcr.io/runatlantis/testing-env:2022.12.17
3131
steps:
3232
- uses: actions/[email protected]
3333
- run: make test-all

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ test: ## Run tests
3636

3737
.PHONY: docker/test
3838
docker/test: ## Run tests in docker
39-
docker run -it -v $(pwd):/atlantis ghcr.io/runatlantis/testing-env:2022.11.17 sh -c "cd /atlantis && make test"
39+
docker run -it -v $(pwd):/atlantis ghcr.io/runatlantis/testing-env:2022.12.17 sh -c "cd /atlantis && make test"
4040

4141
test-all: ## Run tests including integration
4242
@go test $(PKG)
4343

4444
.PHONY: docker/test-all
4545
docker/test-all: ## Run all tests in docker
46-
docker run -it -v $(pwd):/atlantis ghcr.io/runatlantis/testing-env:2022.11.17 sh -c "cd /atlantis && make test-all"
46+
docker run -it -v $(pwd):/atlantis ghcr.io/runatlantis/testing-env:2022.12.17 sh -c "cd /atlantis && make test-all"
4747

4848
test-coverage:
4949
@mkdir -p .cover

server/controllers/events/events_controller_e2e_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ func TestGitHubWorkflowWithPolicyCheck(t *testing.T) {
636636
}
637637
// Ensure we have >= TF 0.14 locally.
638638
ensureRunning014(t)
639-
// Ensure we have >= Conftest 0.21 locally.
639+
// Ensure we have conftest locally.
640640
ensureRunningConftest(t)
641641

642642
cases := []struct {
@@ -1365,9 +1365,9 @@ func mkSubDirs(t *testing.T) (string, string, string) {
13651365

13661366
// Will fail test if conftest isn't in path and isn't version >= 0.25.0
13671367
func ensureRunningConftest(t *testing.T) {
1368-
localPath, err := exec.LookPath(fmt.Sprintf("conftest%s", ConftestVersion))
1368+
localPath, err := exec.LookPath("conftest")
13691369
if err != nil {
1370-
t.Logf("conftest >= %s must be installed to run this test", ConftestVersion)
1370+
t.Logf("conftest must be installed to run this test")
13711371
t.FailNow()
13721372
}
13731373
versionOutBytes, err := exec.Command(localPath, "--version").Output() // #nosec

testing/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ RUN case $(uname -m) in x86_64|amd64) ARCH="x86_64" ;; aarch64|arm64|armv7l) ARC
2222
sed -n "/conftest_${CONFTEST_VERSION}_Linux_${ARCH}.tar.gz/p" checksums.txt | sha256sum -c && \
2323
mkdir -p /usr/local/bin/cft/versions/${CONFTEST_VERSION} && \
2424
tar -C /usr/local/bin/cft/versions/${CONFTEST_VERSION} -xzf conftest_${CONFTEST_VERSION}_Linux_${ARCH}.tar.gz && \
25-
# After migrating e2e test which use contest command instead of contest$version, you can remove contest$version command.
26-
ln -s /usr/local/bin/cft/versions/${CONFTEST_VERSION}/conftest /usr/local/bin/conftest${CONFTEST_VERSION} && \
2725
ln -s /usr/local/bin/cft/versions/${CONFTEST_VERSION}/conftest /usr/local/bin/conftest && \
2826
rm conftest_${CONFTEST_VERSION}_Linux_${ARCH}.tar.gz && \
2927
rm checksums.txt

0 commit comments

Comments
 (0)