Commit 5559cd9f authored by Vojtěch Horký's avatar Vojtěch Horký
Browse files

12: GitLab-aware branch detection

parent 2a4d2657
......@@ -4,6 +4,15 @@
load "../../nswi177"
get_current_branch() {
local result
result="$( git branch --show-current || true )"
if [ -z "$result" ]; then
result="${CI_COMMIT_REF_NAME:-unknown}"
fi
echo "$result"
}
@test "12/csv_calc.sh - Submitted (0)" {
fail_if_missing
}
......@@ -83,7 +92,7 @@ Skye,0,1,1,2'
@test "12/csv_calc.sh - Malicious data injection on master branch (0)" {
skip_if_missing
my_branch="$( git branch --show-current )"
my_branch="$( get_current_branch )"
if [ "$my_branch" != "master" ]; then
skip "This test is executed on master branch only."
fi
......@@ -105,7 +114,7 @@ Skye,0,1,1,2'
@test "12/csv_calc.sh - Malicious data injection on issue/N branch (10)" {
skip_if_missing
my_branch="$( git branch --show-current )"
my_branch="$( get_current_branch )"
if ! echo "$my_branch" | grep -q '^issue/[0-9]*$'; then
skip "This test is executed on issue/N branch only."
fi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment