Skip to content

Commit

Permalink
Merge pull request #988 from smerle33/goss/split
Browse files Browse the repository at this point in the history
chore(goss): split linux and windows common goss tests to a common file
  • Loading branch information
smerle33 authored Jan 15, 2024
2 parents 340051a + 3220a61 commit c98b99a
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 221 deletions.
6 changes: 6 additions & 0 deletions build-jenkins-agent-ubuntu.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ build {
destination = "/tmp/goss-linux.yaml"
}

provisioner "file" {
source = "./goss/goss-common.yaml"
destination = "/tmp/goss-common.yaml"
}

provisioner "breakpoint" {
note = "Enable this breakpoint to pause before trying to run goss tests"
disable = true
Expand All @@ -51,6 +56,7 @@ build {
"source /home/jenkins/.asdf/asdf.sh", # Required as this is a non-interactive and non-login `bash`
"goss --version",
"goss --gossfile /tmp/goss-linux.yaml --loglevel DEBUG validate",
"goss --gossfile /tmp/goss-common.yaml --loglevel DEBUG validate",
]
}

Expand Down
7 changes: 7 additions & 0 deletions build-jenkins-agent-windows.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ build {
destination = "C:/goss-windows.yaml"
}

provisioner "file" {
source = "./goss/goss-common.yaml"
destination = "C:/goss-common.yaml"
}

provisioner "breakpoint" {
note = "Enable this breakpoint to pause before trying to run goss tests"
disable = true
Expand All @@ -84,7 +89,9 @@ build {
"$ErrorActionPreference = 'Stop'",
"goss --version",
"goss --use-alpha=1 --gossfile C:/goss-windows.yaml --loglevel DEBUG validate --retry-timeout 300s",
"goss --use-alpha=1 --gossfile C:/goss-common.yaml --loglevel DEBUG validate --retry-timeout 300s",
"Remove-Item -Force C:/goss-windows.yaml",
"Remove-Item -Force C:/goss-common.yaml",
]
}

Expand Down
114 changes: 114 additions & 0 deletions goss/goss-common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
command:
awscli:
exec: aws --version
exit-status: 0
stdout:
- 2.15.9
azurecli:
exec: az --version
exit-status: 0
stdout:
- 2.56.0
bundle:
exec: bundle -v
exit-status: 0
container-structure-test:
exec: container-structure-test version
exit-status: 0
stdout:
- v1.16.0
default_java:
exec: java --version
exit-status: 0
stdout:
- 11.0.21+9
docker_compose:
exec: docker-compose -v
exit-status: 0
stdout:
- 2.23.3
gh_cli:
exec: gh --version
exit-status: 0
stdout:
- 2.41.0
git_lfs:
exec: git-lfs --version
exit-status: 0
stdout:
- 3.4.1
goss:
exec: goss --version
exit-status: 0
stdout:
- 0.4.4
hadolint:
exec: hadolint -v
exit-status: 0
stdout:
- 2.12.0
jq:
exec: jq --version
exit-status: 0
stdout:
- jq-1.6
jx-release-version:
exec: jx-release-version -version
exit-status: 0
stdout:
- 2.7.3
kubectl:
exec: kubectl version --client
exit-status: 0
stdout:
- 1.23.13
launchable:
exec: launchable --version
exit-status: 0
stdout:
- 1.66.0
make:
exec: make --version
exit-status: 0
netlify-deploy:
exec: netlify-deploy --help
exit-status: 0
nodejs:
exec: node --version
exit-status: 0
stdout:
- 18.18.2
npm:
exec: npm version
exit-status: 0
packer:
exec: packer -v
exit-status: 0
stdout:
- 1.10.0
ruby:
exec: ruby -v
exit-status: 0
stdout:
- 2.6.10
terraform:
exec: terraform -v
exit-status: 0
stdout:
- 1.6.6
trivy:
exec: trivy --version
exit-status: 0
stdout:
- 0.47.0
updatecli:
exec: updatecli version
exit-status: 0
stderr:
- 0.70.0
yq:
exec: yq --version
exit-status: 0
stdout:
- 4.25.3
112 changes: 0 additions & 112 deletions goss/goss-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,17 @@ command:
exit-status: 0
stdout:
- v0.13.1
awscli:
exec: aws --version
exit-status: 0
stdout:
- 2.15.9
azcopy:
exec: azcopy --version
exit-status: 0
stdout:
- 10.22.2
azurecli:
exec: az --version
exit-status: 0
stdout:
- 2.56.0
bundle:
exec: bundle -v
exit-status: 0
chromium-browser:
exec: chromium-browser --version
exit-status: 0
container-structure-test:
exec: container-structure-test version
exit-status: 0
stdout:
- v1.16.0
datadog-agent:
exec: datadog-agent version
exit-status: 0
default_java:
exec: java --version
exit-status: 0
stdout:
- 11.0.21+9
docker-ce:
exec: docker -v
exit-status: 0
Expand All @@ -47,41 +24,16 @@ command:
docker_buildx:
exec: docker buildx version
exit-status: 0
docker_compose:
exec: docker-compose -v
exit-status: 0
stdout:
- 2.23.3
doctl:
exec: doctl version
exit-status: 0
stdout:
- 1.101.0
gh_cli:
exec: gh --version
exit-status: 0
stdout:
- 2.41.0
git:
exec: git --version
exit-status: 0
stdout:
- 2.43.0
git_lfs:
exec: git-lfs --version
exit-status: 0
stdout:
- 3.4.1
goss:
exec: goss --version
exit-status: 0
stdout:
- 0.4.4
hadolint:
exec: hadolint -v
exit-status: 0
stdout:
- 2.12.0
helm:
exec: helm version
exit-status: 0
Expand Down Expand Up @@ -119,50 +71,11 @@ command:
exit-status: 0
stderr:
- 1.8.0_392
jq:
exec: jq --version
exit-status: 0
stdout:
- jq-1.6
jx-release-version:
exec: jx-release-version -version
exit-status: 0
stdout:
- 2.7.3
kubectl:
exec: kubectl version --client
exit-status: 0
stdout:
- 1.23.13
launchable:
exec: launchable --version
exit-status: 0
stdout:
- 1.66.0
make:
exec: make --version
exit-status: 0
maven:
exec: mvn -v
exit-status: 0
stdout:
- 3.9.6
netlify-deploy:
exec: netlify-deploy --help
exit-status: 0
nodejs:
exec: node --version
exit-status: 0
stdout:
- 18.18.2
npm:
exec: npm version
exit-status: 0
packer:
exec: packer -v
exit-status: 0
stdout:
- 1.10.0
parallel:
exec: parallel --version
exit-status: 0
Expand All @@ -174,11 +87,6 @@ command:
python3:
exec: python3 --version
exit-status: 0
ruby:
exec: ruby -v
exit-status: 0
stdout:
- 2.6.10
sops:
exec: sops --version
exit-status: 0
Expand All @@ -187,24 +95,9 @@ command:
ssh_agent:
exec: command -v ssh-agent
exit-status: 0
terraform:
exec: terraform -v
exit-status: 0
stdout:
- 1.6.6
trivy:
exec: trivy --version
exit-status: 0
stdout:
- 0.47.0
unzip:
exec: unzip -v
exit-status: 0
updatecli:
exec: updatecli version
exit-status: 0
stderr:
- 0.70.0
vagrant:
exec: vagrant -v
exit-status: 0
Expand All @@ -216,11 +109,6 @@ command:
yamllint:
exec: yamllint -v
exit-status: 0
yq:
exec: yq --version
exit-status: 0
stdout:
- 4.25.3
zip:
exec: zip -v
exit-status: 0
Expand Down
Loading

0 comments on commit c98b99a

Please sign in to comment.