diff --git a/.github/workflows/conftest.yaml b/.github/workflows/conftest.yaml index 921e0ed2..738c12d0 100644 --- a/.github/workflows/conftest.yaml +++ b/.github/workflows/conftest.yaml @@ -10,4 +10,6 @@ jobs: uses: actions/checkout@v2 - name: Conftest - uses: redhat-cop/github-actions/confbatstest@master \ No newline at end of file + uses: redhat-cop/github-actions/confbatstest@master + with: + tests: _test/conftest.sh \ No newline at end of file diff --git a/_test/_helpers.bash b/_test/_helpers.bash new file mode 100644 index 00000000..d152003c --- /dev/null +++ b/_test/_helpers.bash @@ -0,0 +1,3 @@ +print_err() { + if [ "$1" -ne 0 ]; then echo "$2" | grep "not ok"; fi +} \ No newline at end of file diff --git a/_test/conftest.sh b/_test/conftest.sh new file mode 100755 index 00000000..7aeec684 --- /dev/null +++ b/_test/conftest.sh @@ -0,0 +1,81 @@ +#!/usr/bin/env bats + +load _helpers + +@test "basic-dotnet-core/.openshift" { + run conftest test basic-dotnet-core/.openshift --output tap + print_err "$status" "$output" + [ "$status" -eq 0 ] +} + +@test "basic-nginx/.openshift" { + run conftest test basic-nginx/.openshift --output tap + print_err "$status" "$output" + [ "$status" -eq 0 ] +} + +@test "basic-spring-boot-tekton/.openshift" { + run conftest test basic-spring-boot-tekton/.openshift --output tap + print_err "$status" "$output" + [ "$status" -eq 0 ] +} + +@test "basic-spring-boot/.openshift basic-tomcat/.openshift" { + run conftest test basic-spring-boot/.openshift basic-tomcat/.openshift --output tap + print_err "$status" "$output" + [ "$status" -eq 0 ] +} + +@test "blue-green-spring/.openshift" { + run conftest test blue-green-spring/.openshift --output tap + print_err "$status" "$output" + [ "$status" -eq 0 ] +} + +@test "cucumber-selenium-grid/applier/projects" { + run conftest test cucumber-selenium-grid/applier/projects --output tap + print_err "$status" "$output" + [ "$status" -eq 0 ] +} + +@test "cucumber-selenium-grid/applier/templates" { + run conftest test cucumber-selenium-grid/applier/templates --output tap + print_err "$status" "$output" + [ "$status" -eq 0 ] +} + +@test "jenkins-s2i multi-cluster-multi-branch-jee/.openshift" { + run conftest test jenkins-s2i multi-cluster-multi-branch-jee/.openshift --output tap + print_err "$status" "$output" + [ "$status" -eq 0 ] +} + +@test "multi-cluster-spring-boot/image-mirror-example/.applier/projects" { + run conftest test multi-cluster-spring-boot/image-mirror-example/.applier/projects --output tap + print_err "$status" "$output" + [ "$status" -eq 0 ] +} + +@test "multi-cluster-spring-boot/image-mirror-example/.applier/templates" { + run conftest test multi-cluster-spring-boot/image-mirror-example/.applier/templates --output tap + print_err "$status" "$output" + [ "$status" -eq 0 ] +} + +@test "multi-cluster-spring-boot/skopeo-example/.applier/projects" { + run conftest test multi-cluster-spring-boot/skopeo-example/.applier/projects --output tap + print_err "$status" "$output" + [ "$status" -eq 0 ] +} + +@test "multi-cluster-spring-boot/skopeo-example/.applier/templates" { + run conftest test multi-cluster-spring-boot/skopeo-example/.applier/templates --output tap + print_err "$status" "$output" + [ "$status" -eq 0 ] +} + +@test "secure-spring-boot/.openshift-applier/templates" { + run conftest test secure-spring-boot/.openshift-applier/templates --output tap + print_err "$status" "$output" + [ "$status" -eq 0 ] +} \ No newline at end of file diff --git a/_test/tests.bats b/_test/tests.bats deleted file mode 100755 index a3457328..00000000 --- a/_test/tests.bats +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env bats - -@test "basic-dotnet-core/.openshift" { - run conftest test basic-dotnet-core/.openshift --output tap - - [ "$status" -eq 0 ] -} - -@test "basic-nginx/.openshift" { - run conftest test basic-nginx/.openshift --output tap - - [ "$status" -eq 0 ] -} - -@test "basic-spring-boot-tekton/.openshift" { - run conftest test basic-spring-boot-tekton/.openshift --output tap - - [ "$status" -eq 0 ] -} - -@test "basic-spring-boot/.openshift basic-tomcat/.openshift" { - run conftest test basic-spring-boot/.openshift basic-tomcat/.openshift --output tap - - [ "$status" -eq 0 ] -} - -@test "blue-green-spring/.openshift" { - run conftest test blue-green-spring/.openshift --output tap - - [ "$status" -eq 0 ] -} - -@test "cucumber-selenium-grid/applier/projects" { - run conftest test cucumber-selenium-grid/applier/projects --output tap - - [ "$status" -eq 0 ] -} - -@test "cucumber-selenium-grid/applier/templates" { - run conftest test cucumber-selenium-grid/applier/templates --output tap - - [ "$status" -eq 0 ] -} - -@test "jenkins-s2i multi-cluster-multi-branch-jee/.openshift" { - run conftest test jenkins-s2i multi-cluster-multi-branch-jee/.openshift --output tap - - [ "$status" -eq 0 ] -} - -@test "multi-cluster-spring-boot/image-mirror-example/.applier/projects" { - run conftest test multi-cluster-spring-boot/image-mirror-example/.applier/projects --output tap - - [ "$status" -eq 0 ] -} - -@test "multi-cluster-spring-boot/image-mirror-example/.applier/templates" { - run conftest test multi-cluster-spring-boot/image-mirror-example/.applier/templates --output tap - - [ "$status" -eq 0 ] -} - -@test "multi-cluster-spring-boot/skopeo-example/.applier/projects" { - run conftest test multi-cluster-spring-boot/skopeo-example/.applier/projects --output tap - - [ "$status" -eq 0 ] -} - -@test "multi-cluster-spring-boot/skopeo-example/.applier/templates" { - run conftest test multi-cluster-spring-boot/skopeo-example/.applier/templates --output tap - - [ "$status" -eq 0 ] -} - -@test "secure-spring-boot/.openshift-applier/templates" { - run conftest test secure-spring-boot/.openshift-applier/templates --output tap - - [ "$status" -eq 0 ] -} \ No newline at end of file