containers / toolbox

Tool for interactive command line environments on Linux
https://containertoolbx.org/
Apache License 2.0
2.39k stars 208 forks source link

test/system: Make it easier to debug why a container didn't initialize #1374

Closed debarshiray closed 9 months ago

debarshiray commented 9 months ago

Currently, if a Toolbx container's entry point fails to initialize the container, there's no way to see the debug logs and error messages from the entry point:

  not ok 106 container: Check container starts without issues
  # (from function `assert_success' in file
       test/system/libs/bats-assert/src/assert.bash, line 114,
  #  in test file test/system/103-container.bats, line 39)
  #   `assert_success' failed
  #
  # -- command failed --
  # status : 1
  # output :
  # --
  #

Instead, from now on, they will be visible:

  not ok 106 container: Check container starts without issues
  # (from function `assert_success' in file
       test/system/libs/bats-assert/src/assert.bash, line 114,
  #  in test file test/system/103-container.bats, line 39)
  #   `assert_success' failed
  #
  # -- command failed --
  # status : 1
  # output (90 lines):
  #   Failed to initialize container fedora-toolbox-38
  #   level=debug msg="Running as real user ID 0"
  #   level=debug msg="Resolved absolute path to the executable as
        /usr/bin/toolbox"
  #   level=debug msg="TOOLBOX_PATH is /opt/bin/toolbox"
  #   level=debug msg="Migrating to newer Podman"
  #   level=debug msg="Migration not needed: running inside a container"
  #   level=debug msg="Setting up configuration"
  #   ...
  # --
  #
softwarefactory-project-zuul[bot] commented 9 months ago

Build failed. https://softwarefactory-project.io/zuul/t/local/buildset/85957e4128c445e8b2c26605c139230e

:heavy_check_mark: unit-test SUCCESS in 8m 57s :heavy_check_mark: unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 36s :heavy_check_mark: unit-test-restricted SUCCESS in 7m 18s :x: system-test-fedora-rawhide FAILURE in 57m 52s :x: system-test-fedora-38 TIMED_OUT in 40m 35s :x: system-test-fedora-37 TIMED_OUT in 40m 35s

softwarefactory-project-zuul[bot] commented 9 months ago

Build failed. https://softwarefactory-project.io/zuul/t/local/buildset/372714094d5046e18b6b1ddc71527f76

:heavy_check_mark: unit-test SUCCESS in 8m 36s :heavy_check_mark: unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 16s :heavy_check_mark: unit-test-restricted SUCCESS in 6m 45s :x: system-test-fedora-rawhide FAILURE in 36m 05s :heavy_check_mark: system-test-fedora-38 SUCCESS in 29m 44s :heavy_check_mark: system-test-fedora-37 SUCCESS in 28m 31s

debarshiray commented 9 months ago

There are still some test failures on Fedora Rawhide. For example:

fedora-rawhide | not ok 3 help: Run command 'help' in 145ms
fedora-rawhide | # (from function `assert_line' in file test/system/libs/bats-assert/src/assert.bash, line 479,
fedora-rawhide | #  in test file test/system/002-help.bats, line 45)
fedora-rawhide | #   `assert_line --index 0 --partial "toolbox(1)"' failed
fedora-rawhide | # /usr/bin/man
fedora-rawhide | #
fedora-rawhide | # -- line does not contain substring --
fedora-rawhide | # index     : 0
fedora-rawhide | # substring : toolbox(1)
fedora-rawhide | # line      : troff:<standard input>:33: warning: cannot select font 'C'
fedora-rawhide | # --

I believe these are because of changes in various other components in Fedora 39, which we need to track down one by one and work out a fix.

In the mean time, I am going to temporarily override these failures.