update tests and try '--gather-test-outputs-in' for results output instead of redirection.

This commit is contained in:
Kameron Kenny 2024-12-20 09:38:26 -05:00
parent fae768b79b
commit e2ecee732d
4 changed files with 5 additions and 28 deletions

6
Jenkinsfile vendored
View File

@ -105,9 +105,9 @@ pipeline {
stage('Integration Tests') {
steps {
sh 'mkdir -p test/results/integration'
sh 'bats -F junit test/integration/dns/thelinux.pro/*.bat test/integration/dns/thelinux.pro/**/*.bat > test/results/integration/TEST-Integration-dns-thelinux_pro.xml'
sh 'bats -F junit test/integration/dns/kameronkenny.com/*.bat test/integration/dns/kameronkenny.com/**/*.bat > test/results/integration/TEST-Integration-dns-kameronkenny_com.xml'
sh 'bats -F junit test/integration/dns/in.thelinuxpro.net/*.bat test/integration/dns/in.thelinuxpro.net/**/*.bat > test/results/integration/TEST-Integration-dns-in_thelinuxpro_net.xml'
sh 'bats -F junit --gather-test-outputs-in test/results/integration test/integration/dns/thelinux.pro/*.bat test/integration/dns/thelinux.pro/**/*.bat
sh 'bats -F junit --gather-test-outputs-in test/results/integration test/integration/dns/kameronkenny.com/*.bat test/integration/dns/kameronkenny.com/**/*.bat
sh 'bats -F junit --gather-test-outputs-in test/results/integration test/integration/dns/in.thelinuxpro.net/*.bat test/integration/dns/in.thelinuxpro.net/**/*.bat
}
}
}

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bats
load 'local-setup'
_local_setup
load 'helper'
@test "Test A Record: ${domain}" {
run dig -t A ${domain} +noall +answer
assert_output --partial "${ip}"
}

View File

@ -2,9 +2,10 @@
_local_setup() {
DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd)"
TEST_ROOT="$( cd "$( dirname "$DIR/../../" )" >/dev/null 2>&1 && pwd)"
TEST_ROOT="$( cd "$( dirname "$DIR/../../../" )" >/dev/null 2>&1 && pwd)"
bats_load_library bats-support
bats_load_library bats-assert
load "$TEST_ROOT/test_helper/dns-functions"
source "$DIR/helper.bash"
}

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bats
load 'local-setup'
_local_setup
load 'helper'
@test "Test SOA Record: ${domain}" {
run dig -t SOA ${domain} +noall +answer +multi
assert_output --partial "${serial}"
}