diff --git a/task/sast-snyk-check/0.3/tests/test-sast-snyk-check.yaml b/task/sast-snyk-check/0.3/tests/test-sast-snyk-check.yaml new file mode 100644 index 0000000000..cec81e1dcd --- /dev/null +++ b/task/sast-snyk-check/0.3/tests/test-sast-snyk-check.yaml @@ -0,0 +1,57 @@ +--- +apiVersion: tekton.dev/v1 +kind: Pipeline +metadata: + name: test-sast-snyk-check +spec: + description: | + Test the sast-snyk-check task with the DVWA web application + workspaces: + - name: tests-workspace + tasks: + - name: run-task + workspaces: + - name: output + workspace: tests-workspace + params: + - name: url + value: https://github.com/digininja/DVWA + - name: revision + value: 2.4 + taskRef: + resolver: git + params: + - name: url + value: https://github.com/konflux-ci/build-definitions.git + - name: revision + value: main + - name: pathInRepo + value: task/git-clone/0.1/git-clone.yaml + - name: scan-with-snyk + workspaces: + - name: workspace + workspace: tests-workspace + runAfter: + - run-task + taskRef: + name: sast-snyk-check + params: + - name: image-digest + value: "947d5d3297fbfc17a66546a3427e12be13cd131d" + - name: image-url + value: "https://github.com/digininja/DVWA" + - name: check-result + runAfter: + - scan-with-snyk + workspaces: + - name: workspace + workspace: tests-workspace + taskSpec: + steps: + - name: check-result + image: quay.io/konflux-ci/appstudio-utils:48c311af02858e2422d6229600e9959e496ddef1@sha256:91ddd999271f65d8ec8487b10f3dd378f81aa894e11b9af4d10639fd52bba7e8 + script: | + #!/usr/bin/env sh + set -eux + files=$(find "$(workspaces.tests-workspace.path)/source/" -mindepth 1 -maxdepth 1) + test -n "$files" \ No newline at end of file