Closed izgeri closed 3 years ago
Our current test script does everything, see https://github.com/cyberark/conjur-service-broker/blob/master/ci/test.sh#L7-L27
function main() {
# TODO - The commented arguments are throwing an exeception unreleated to the
# success of the RSpec test. We need to get this resolved and export the
# resulting XML file to the `spec/reports` folder for Jenkins to pickup.
rspec # --format RspecJunitFormatter --out spec/reports/test.xml
# Skip the integration tests if the Summon variables are not present
if [ -z "$CF_API_ENDPOINT" ]; then
INTEGRATION_TAG="--tags ~@integration"
else
# Make sure all of the environment are present for the integration tests
: ${PCF_CONJUR_ACCOUNT?"Need to set PCF_CONJUR_ACCOUNT"}
: ${PCF_CONJUR_APPLIANCE_URL?"Need to set PCF_CONJUR_APPLIANCE_URL"}
: ${PCF_CONJUR_USERNAME?"Need to set PCF_CONJUR_USERNAME"}
: ${PCF_CONJUR_API_KEY?"Need to set STATE"}
install_buildpack
fi
cucumber --format junit \
--out features/reports \
$INTEGRATION_TAG \
--format pretty \
--backtrace \
--verbose
}
The desired split should amount to the following:
bin/test_unit
:
# TODO - The commented arguments are throwing an exeception unreleated to the
# success of the RSpec test. We need to get this resolved and export the
# resulting XML file to the `spec/reports` folder for Jenkins to pickup.
rspec # --format RspecJunitFormatter --out spec/reports/test.xml
bin/test_integration
:
# Excludes integration test scenarios (those that require external services)
cucumber --format junit \
--out features/reports \
--tags ~@integration \
--format pretty \
--backtrace \
--verbose
bin/test_e2e
:
# Run integration tests only
cucumber --format junit \
--out features/reports \
--tags @integration \
--format pretty \
--backtrace \
--verbose
AC:
bin/test_unit
for running unit tests andbin/test_integration
for running lightweight integration tests