Skip to content

Commit

Permalink
Merge pull request #373 from RedHatProductSecurity/feature/OSIDB-3214…
Browse files Browse the repository at this point in the history
…-integration-tests

OSIDB-3214: Save test reports as junit when on CI
  • Loading branch information
MrMarble authored Aug 1, 2024
2 parents 618ad8b + 0e4f8e7 commit 790c095
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ coverage
*.py[co]
__pycache__
*.env
venv
reports
30 changes: 22 additions & 8 deletions scripts/run_automation_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,42 @@

# run this script on root dir or osim codebase, ./scripts/run_automation_test.sh

if ! behave features/login.feature; then

run_behave() {
args="$@"

# set arguments if "ci" argument is passed
if [[ -v CI ]]; then
args="$@ --junit --junit-directory=reports --no-summary"
fi

behave $args
return $?
}


if ! run_behave features/login.feature; then
echo "login to osim failed, skip the rest of tests"
exit 1
fi

if behave features/flaw_create_embargo.feature; then
behave features/flaw_detail_embargo.feature --tags=~@skip
if run_behave features/flaw_create_embargo.feature; then
run_behave features/flaw_detail_embargo.feature --tags=~@skip
else
echo "flaw_create_embargo.feature failed, skip flaw_detail_embargo.feature"
fi

if behave features/flaw_create_public.feature; then
behave features/flaw_detail_public.feature --tags=~@skip
if run_behave features/flaw_create_public.feature; then
run_behave features/flaw_detail_public.feature --tags=~@skip
else
echo "flaw_create_public.feature failed, skip flaw_detail_public.feature"
fi

if [ -e flaw_id.txt ]
then
behave features/advance_search.feature
behave features/flaw_list.feature
behave features/quick_search.feature
run_behave features/advance_search.feature
run_behave features/flaw_list.feature
run_behave features/quick_search.feature
else
echo "All flaw for test created failed, skip advance_search.feature,
flaw_list.feature, quick_search.feature"
Expand Down

0 comments on commit 790c095

Please sign in to comment.