Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] .github/workflows: Try to enable all tests on Ubuntu 22.04 and 24.04 #1505

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 55 additions & 1 deletion .github/workflows/ubuntu-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,62 @@ 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 --print-output-on-failure --show-output-of-passing-tests --timing --verbose-run test/system
env:
TMPDIR: /var/tmp
TOOLBX: /usr/local/bin/toolbox
working-directory: containers/toolbox

ubuntu-noble-tests:
runs-on: ubuntu-24.04

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Install deb packages
run: |
sudo apt-get update
sudo apt-get install \
apache2-utils \
bash-completion \
bats \
codespell \
fish \
gcc \
go-md2man \
golang \
libsubid-dev \
meson \
ninja-build \
openssl \
podman \
shellcheck \
skopeo \
systemd \
udisks2

- name: Download Go modules
run: go mod download -x
working-directory: src

- name: Set up build directory
run: meson setup --fatal-meson-warnings builddir

- name: Build
run: meson compile -C builddir --verbose

- name: Install
run: sudo meson install -C builddir

- name: Unit tests
run: meson test -C builddir --verbose

- name: System tests
run: bats --timing test/system
env:
SHELL: /bin/bash
TMPDIR: /var/tmp
TOOLBX: /usr/local/bin/toolbox
18 changes: 10 additions & 8 deletions test/system/104-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,18 @@ teardown() {
@test "run: 'sudo id' inside the default container" {
create_default_container

output="$("$TOOLBX" --verbose run sudo id 2>"$BATS_TEST_TMPDIR/stderr")"
status="$?"

echo "# stderr"
cat "$BATS_TEST_TMPDIR/stderr"
echo "# stdout"
echo "$output"
run --keep-empty-lines --separate-stderr "$TOOLBX" run sudo id

assert_success
assert_output --partial "uid=0(root)"
assert_line --index 0 "uid=0(root) gid=0(root) groups=0(root)"

if check_bats_version 1.10.0; then
assert [ ${#lines[@]} -eq 1 ]
else
assert [ ${#lines[@]} -eq 2 ]
fi

assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "run: Ensure that /run/.containerenv exists" {
Expand Down
Loading