Skip to content

Commit

Permalink
github-actions: skip failing tests
Browse files Browse the repository at this point in the history
These two tests which should add groups to the current user are not
working in GitHub Actions, but they are working on a standard computer.
Since the user used in GitHub Actions is called "runner", we can use
this specific name to exclude these tests in GitHub.
  • Loading branch information
florentsfl committed Jan 17, 2025
1 parent 084ab45 commit c71bed3
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions tests/05-cqfd_run_extra_groups
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
#!/usr/bin/env bash
if [ "$USER" != "runner" ]; then
. "$(dirname $0)"/jtest.inc "$1"
cqfd="$TDIR/.cqfd/cqfd"

. "$(dirname $0)"/jtest.inc "$1"
cqfd="$TDIR/.cqfd/cqfd"
cd $TDIR/

cd $TDIR/
################################################################################
# 'cqfd run' should add extra_groups provided by an environment variable
################################################################################
jtest_prepare "'cqfd run' should add extra_groups provided by an env variable"
result=$(user_extra_groups="docker newgroup:12345" $cqfd run 'groups' | grep docker | grep newgroup)

################################################################################
# 'cqfd run' should add extra_groups provided by an environment variable
################################################################################
jtest_prepare "'cqfd run' should add extra_groups provided by an env variable"
result=$(user_extra_groups="docker newgroup:12345" $cqfd run 'groups' | grep docker | grep newgroup)
if [ -n "$result" ]; then
jtest_result pass
else
jtest_result fail
fi

if [ -n "$result" ]; then
jtest_result pass
else
jtest_result fail
fi
################################################################################
# 'cqfd run' should add extra_groups provided by the config
################################################################################
jtest_prepare "'cqfd run' should add config's extra_groups to the local user"
echo 'user_extra_groups="docker newgroup:12345"' >> .cqfdrc
result=$($cqfd run 'groups' | grep docker | grep newgroup)

################################################################################
# 'cqfd run' should add extra_groups provided by the config
################################################################################
jtest_prepare "'cqfd run' should add config's extra_groups to the local user"
echo 'user_extra_groups="docker newgroup:12345"' >> .cqfdrc
result=$($cqfd run 'groups' | grep docker | grep newgroup)
if [ -n "$result" ]; then
jtest_result pass
else
jtest_result fail
fi

if [ -n "$result" ]; then
jtest_result pass
else
jtest_result fail
fi

0 comments on commit c71bed3

Please sign in to comment.