Skip to content

Commit

Permalink
.github/workflows: Enable more tests on Ubuntu 22.04 by setting SHELL
Browse files Browse the repository at this point in the history
The SHELL environment variable goes mysteriously missing from the
runtime environment of the GitHub Actions workflow [1].  This breaks the
'create' and 'enter' commands with:
  Error: failed to get the current user's default shell

... and therefore tests involving them can't be run until this is
resolved.

It's been a year since this problem was first encountered and no
solution is in sight.  Therefore, it will be better to work around this
by explicitly setting the SHELL environment variable on Ubuntu 22.04 to
increase the number of tests run by the CI.

The 'list' tests couldn't be enabled due to:
  $ bats test/system
  ...
  not ok 110 list: Containers and images
  # (from function `assert_line' in file
      test/system/libs/bats-assert/src/assert.bash, line 479,
  #  in test file test/system/102-list.bats, line 502)
  #   `assert_line --index 1 --partial
        "registry.fedoraproject.org/fedora-toolbox:34"' failed
  #
  # -- line does not contain substring --
  # index     : 1
  # substring : registry.fedoraproject.org/fedora-toolbox:34
  # line      : 5c5b1421750d  quay.io/toolbx/ubuntu-toolbox:22.04
                  28 hours ago
  # --
  #
  ...

The 'run' tests couldn't be enabled due to:
  $ bats --print-output-on-failure --verbose-run test/system
  ...
  not ok 134 run: 'sudo id' inside the default container
  # (from function `assert_success' in file
      test/system/libs/bats-assert/src/assert.bash, line 114,
  #  in test file test/system/104-run.bats, line 208)
  #   `assert_success' failed
  # ~ ~/work/toolbox/toolbox/containers/toolbox
  # stderr:
  # runner is not in the sudoers file.  This incident will be reported.
  #
  # -- command failed --
  # status : 1
  # output :
  # --
  #
  ...

The 'user' tests couldn't be enabled due to:
  $ bats test/system
  ...
  not ok 243 user: runner in passwd(5) inside the default container
  # (from function `assert_line' in file
      test/system/libs/bats-assert/src/assert.bash, line 509,
  #  in test file test/system/206-user.bats, line 190)
  #   `assert_line --regexp
        "^$USER::$user_id_real:$user_id_real:$user_gecos:$HOME:$SHELL$"'
        failed
  # ~ ~/work/toolbox/toolbox/containers/toolbox
  #
  # -- no output line matches regular expression --
  # regexp : ^runner::1001:1001:,,,:/home/runner:/bin/bash$
  # output (27 lines):
  #   root:x:0:0:root:/root:/bin/bash
  #   ...
  #   runner::1001:127::/home/runner:/bin/bash
  # --
  #
  ...

The 'ulimit' tests couldn't be enabled due to:
  $ bats test/system
  ...
  not ok 271 ulimit: real-time non-blocking time (hard) in 3504ms
  # (from function `assert_line' in file
      test/system/libs/bats-assert/src/assert.bash, line 488,
  #  in test file test/system/210-ulimit.bats, line 43)
  #   `assert_line --index 0 "$limit"' failed
  # ~ ~/work/toolbox/toolbox/containers/toolbox
  #
  # -- line differs --
  # index    : 0
  # expected : unlimited
  # actual   :
  # --
  #
  ...

The 'dbus' tests couldn't be enabled due to:
  $ bats --print-output-on-failure --verbose-run test/system
  ...
  not ok 206 dbus: session bus inside the default container
  # (from function `assert_success' in file
      test/system/libs/bats-assert/src/assert.bash, line 114,
  #  in test file test/system/211-dbus.bats, line 50)
  #   `assert_success' failed
  # ~ ~/work/toolbox/toolbox/containers/toolbox
  # stderr:
  # bash: line 1: exec: gdbus: not found
  # Error: command gdbus not found in container ubuntu-toolbox-22.04
  #
  # -- command failed --
  # status : 127
  # output :
  # --
  #
  ...

[1] https://github.com/orgs/community/discussions/59413

#1507
  • Loading branch information
debarshiray committed Jun 5, 2024
1 parent 05e700a commit c22b09d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/ubuntu-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,21 @@ jobs:
working-directory: containers/toolbox

- name: System tests
run: bats --timing test/system/001-version.bats test/system/002-help.bats test/system/108-completion.bats
run: |
bats --timing \
test/system/001-version.bats \
test/system/002-help.bats \
test/system/101-create.bats \
test/system/103-container.bats \
test/system/105-enter.bats \
test/system/106-rm.bats \
test/system/107-rmi.bats \
test/system/108-completion.bats \
test/system/201-ipc.bats \
test/system/203-network.bats \
test/system/220-environment-variables.bats
env:
SHELL: /bin/bash
TMPDIR: /var/tmp
TOOLBX: /usr/local/bin/toolbox
working-directory: containers/toolbox

0 comments on commit c22b09d

Please sign in to comment.