Files
atlantis/testing
Eng Zer Jun 49c5eba458 test: use T.TempDir to create temporary test directory (#2671)
This commit replaces `os.MkdirTemp` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `os.MkdirTemp`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-11-13 14:13:29 -06:00
..
2021-05-13 14:00:36 -07:00
2022-11-13 13:11:32 -06:00

Test Docker Image

The Docker image used by the tests is runatlantis/testing-env. It's built by the Dockerfie in this directory.

The image is automatically built by Docker Hub on merges to master.

To update the image, create a pull request that updates the Dockerfile and get it merged to master.

Wait until the build at https://hub.docker.com/repository/docker/runatlantis/testing-env/builds finishes and then scroll to the bottom to find output like:

01216b26cd75183360909a50217a39d55a9265e7: digest: sha256:9c26943a576bf8aaa7a3790f3f8677c68747114e027cfbc361717f49b958e2d1 size: 4741
Build finished

The sha 01216b26cd75183360909a50217a39d55a9265e7 is the tag of the latest image.

In .circleci/config.yml, update the image to reference the new tag:

jobs:
  test:
    docker:
-    - image: runatlantis/testing-env:<old tag>
+    - image: runatlantis/testing-env:<new tag>

And open up a PR.