1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00
sap-jenkins-library/pkg
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
..
abap Add abap source client to generic build step (#3834) 2022-07-07 08:44:51 +02:00
abaputils test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
ado ADO - Vault Secret Rotation (#3084) 2021-09-08 16:48:12 +02:00
ans [ANS] logrus hook (#3671) 2022-06-17 16:40:45 +02:00
apim ApiProxyList Command (#3794) 2022-06-21 13:08:00 +02:00
blackduck detectExecuteScan : Bug fix : Dont consider ignored components (#3867) 2022-07-11 10:50:31 +02:00
buildsettings feat(cnbBuild): generate buildSettingInfo 2022-06-15 12:37:21 +02:00
certutils feat(golangBuild): support private modules (#3471) 2022-01-31 10:45:40 +01:00
checkmarx feat(checkmarxExecuteScan): remove some useless SARIF code, added security-severity (#3857) 2022-06-28 15:39:17 +02:00
cloudfoundry Add telemetry for abapEnvironment steps (#3016) 2021-08-04 17:31:16 +02:00
cnbutils test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
command feat: url log parsing / reporting when executing a command (#3461) 2022-02-25 15:35:44 +01:00
config test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
cpi ApiProxyList Command (#3794) 2022-06-21 13:08:00 +02:00
docker fix (whitesourceExecuteScan) keep tar extension for target image donwload (#3774) 2022-05-13 18:56:41 +02:00
documentation replace depreacted strings.Title function (#3786) 2022-05-20 18:50:03 +02:00
format feat(SARIF): ContextRegion is now a pointer, can be omitted. In checkmarxExecuteScan: threadflows now added, only first location saved (#3844) 2022-06-22 08:54:24 +02:00
fortify fix(fortifyExecuteScan): remove unneeded parameter (project), fix rule ID in rules (#3866) 2022-06-30 17:00:29 +02:00
gcs GCS Upload fixes (#3387) 2022-01-19 13:16:57 +01:00
generator [ANS] Change helper and re-generate steps (#3675) 2022-06-22 13:31:17 +02:00
git feat(gitopsUpdateDeployment) forcePush (#3665) 2022-04-07 16:33:46 +02:00
github feat(whitesourceExecuteScan): GitHub issue creation + SARIF (#3535) 2022-02-23 09:30:19 +01:00
goget feat(golangBuild): support private modules (#3471) 2022-01-31 10:45:40 +01:00
gradle feat(gradleExecuteBuild, fortifyExecuteScan): gradle improvements (#3807) 2022-06-07 10:24:10 +02:00
hadolint/mocks refactor(hadolint): implement step in GO (#1169) 2020-11-16 15:14:54 +01:00
http test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
influx Added go-based influxWriteData step (#2890) 2021-06-30 11:18:49 +02:00
java feat(sonar): reuse existing TLS truststore (#3312) 2021-12-16 12:49:15 +01:00
jenkins fix(jenkins): fix job invocation (#2868) 2021-06-02 16:45:22 +02:00
kubernetes helmExecute: Improve RunHelmLint method (#3873) 2022-07-05 18:22:49 +06:00
log test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
malwarescan feat(malwareExecuteScan): refactoring and docker support (#3421) 2022-01-24 09:48:01 +01:00
maven (feat) mtaBuild publish mtar artifacts to remote remote repo (#3104) 2021-09-23 15:33:30 +02:00
mock feat(kubernetesDeploy): add infrastructure extensibility (#3853) 2022-06-29 12:00:37 +02:00
multiarch chore(multiarch): helper to parse targetArchitectures (#3525) 2022-02-10 16:46:00 +01:00
nexus nexusUpload parameters reading from commonPipelineEnvironment (#2658) 2021-03-10 15:06:42 +01:00
npm chore(npmExecuteScripts): config@2 support (#3607) 2022-03-04 10:26:46 +01:00
orchestrator feat(orchestrator package) Adds GetChangeSet functionality to Jenkins provider (#3852) 2022-06-30 12:49:21 +02:00
piperenv test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
piperutils test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
protecode feat(docker): use crane for pulling docker images (#3652) 2022-03-23 10:02:00 +01:00
reporting feat(detectExecuteScan): SARIF export and GH issue creation (#3637) 2022-03-17 15:32:48 +01:00
sonar fix(sonarExecuteScan): error handling for report metrics (#3512) 2022-02-07 16:41:36 +01:00
splunk Activates debug information for environment variables (#3630) 2022-03-14 10:17:55 +01:00
telemetry fix(orchestrator) usage of correct env variables (#3650) 2022-03-28 09:52:15 +02:00
terraform feat(terraformExecute): pass tf outputs to cpe (#3241) 2021-11-04 10:28:41 +01:00
toolrecord test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
transportrequest Implement Release 3.0.0 of CM-Client (#3664) 2022-04-05 12:33:19 +02:00
validation Fixed validation for possibleValues option (#3228) 2021-11-15 12:06:48 +01:00
vault chore: align Vault naming (#3372) 2021-12-21 11:52:10 +01:00
versioning test: use T.TempDir to create temporary test directory (#3721) 2022-07-12 15:19:12 +02:00
whitesource whitesourceExecuteScan : add log level trace (#3745) 2022-04-22 13:19:49 +02:00
xsuaa Add bearer token retrieval function (#3595) 2022-03-16 11:22:48 +01:00
yaml chore(go): simplify code using gofmt -s (#2065) 2020-09-24 08:58:53 +02:00