Skip to content

Commit

Permalink
Added help method to print out failed tests (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
garethahealy committed Jun 9, 2020
1 parent c93d696 commit 2ba8d5b
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 80 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/conftest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ jobs:
uses: actions/checkout@v2

- name: Conftest
uses: redhat-cop/github-actions/confbatstest@master
uses: redhat-cop/github-actions/confbatstest@master
with:
tests: _test/conftest.sh
3 changes: 3 additions & 0 deletions _test/_helpers.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
print_err() {
if [ "$1" -ne 0 ]; then echo "$2" | grep "not ok"; fi
}
81 changes: 81 additions & 0 deletions _test/conftest.sh
Original file line number Diff line number Diff line change
@@ -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 ]
}
79 changes: 0 additions & 79 deletions _test/tests.bats

This file was deleted.

0 comments on commit 2ba8d5b

Please sign in to comment.