1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/integration
Eng Zer Jun 0f4e30e9db
test: use T.TempDir to create temporary test directory (#3721)
This commit replaces `ioutil.TempDir` 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 `ioutil.TempDir`
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>

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-07-12 15:19:12 +02:00
..
testdata feat(gradleExecuteBuild, fortifyExecuteScan): gradle improvements (#3807) 2022-06-07 10:24:10 +02:00
contracts_test.go test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
docker_integration_test_executor.go added integration tests 2022-04-26 09:38:49 +02:00
integration_api_cli_test.go feat(whitesourceExecuteScan): GitHub issue creation + SARIF (#3535) 2022-02-23 09:30:19 +01:00
integration_cli_test.go test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
integration_cnb_test.go feat(cnbBuild): cache buildpacks during multi-image build (#3635) 2022-03-30 13:58:16 +02:00
integration_gauge_test.go test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
integration_gcs_test.go feat(whitesourceExecuteScan): GitHub issue creation + SARIF (#3535) 2022-02-23 09:30:19 +01:00
integration_github_test.go test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
integration_gitopsUpdateDeployment_test.go (fix) gitopsUpdateDeployment - integration test for kustomize (#3572) 2022-02-25 16:38:02 +01:00
integration_golang_test.go added integration tests 2022-04-26 09:38:49 +02:00
integration_gradle_test.go test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
integration_influx_test.go feat(whitesourceExecuteScan): GitHub issue creation + SARIF (#3535) 2022-02-23 09:30:19 +01:00
integration_jenkins_test.go fix(jenkins): fix job invocation (#2868) 2021-06-02 16:45:22 +02:00
integration_maven_test.go adding parallel execution for integration test of golang gradle and maven (#3677) 2022-03-29 07:38:11 +02:00
integration_mta_build_test.go feat(whitesourceExecuteScan): GitHub issue creation + SARIF (#3535) 2022-02-23 09:30:19 +01:00
integration_nexus_upload_test.go feat(whitesourceExecuteScan): GitHub issue creation + SARIF (#3535) 2022-02-23 09:30:19 +01:00
integration_npm_execute_scripts_test.go test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
integration_python_build_test.go test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
integration_sonar_test.go feat(whitesourceExecuteScan): GitHub issue creation + SARIF (#3535) 2022-02-23 09:30:19 +01:00
integration_test.go test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
integration_vault_test.go feat(whitesourceExecuteScan): GitHub issue creation + SARIF (#3535) 2022-02-23 09:30:19 +01:00
piper-command-wrapper.sh Rewrite mta IT using docker cli (#1819) 2020-07-20 18:07:08 +02:00
run-tests.sh Increased timeout for integration tests (#3648) 2022-03-18 16:30:41 +01:00