Open tomeichlersmith opened 8 months ago
Switching from --user UID:GID
to --userns=host
breaks the Linux-host, docker-runner tests, so I tried including both. Those tests are what I'm reporting on here. I've copied the full log output below for future reference since the logs get deleted within 30ish days.
The directory seen by denv
and the one "seen" by the host are different. denv has an extra /private
prefix (the actual
) compared to what the host sees (the expected
which is just the value of ${PWD}
in this test). This breaks several of the tests, but most obviously the test attempting to print and check the configuration.
not ok 8 print config
# tags: norunner
# (from function `assert_line' in file test/test_helper/bats-assert/src/assert_line.bash, line 202,
# in test file test/config.bats, line 56)
# `assert_line --index 0 "denv_workspace=\"${PWD}\""' failed
#
# -- line differs --
# index : 0
# expected : denv_workspace="/var/folders/h1/8hndypj13nsbj5pn4xsnv1tm0000gn/T/config.bats-8-oCmHnG"
# actual : denv_workspace="/private/var/folders/h1/8hndypj13nsbj5pn4xsnv1tm0000gn/T/config.bats-8-oCmHnG"
# --
_denv_entrypoint
via docker does not have permission to write into the workspace directory. This also breaks many tests, for example
not ok 13 denv name available in denv
# (from function `assert_success' in file test/test_helper/bats-assert/src/assert_success.bash, line 42,
# in test file test/env-var.bats, line 17)
# `assert_success' failed
#
# -- command failed --
# status : 1
# output : cp: cannot create regular file '/private/var/folders/h1/8hndypj13nsbj5pn4xsnv1tm0000gn/T/env-var.bats-1-1tHISE/.bashrc': Permission denied
# --
The tests are not written with MacOS's non-POSIX utils in mind. Test 28 fails to get setup since I use the -t
flag of cp
which isn't available on MacOS.
not ok 28 setup_file failed
# (from function `setup_file' in test file test/network.bats, line 9)
# `cp -t . ${OLDPWD}/test/internet-access.py' failed with status 64
... image being downloaded output ...
# cp: illegal option -- t
# usage: cp [-R [-H | -L | -P]] [-fi | -n] [-aclpsvXx] source_file target_file
# cp [-R [-H | -L | -P]] [-fi | -n] [-aclpsvXx] source_file ... target_directory
Test 31 also fails due to a difference in how stat
works.
not ok 31 file created inside denv has id match
# (from function `assert_equal' in file test/test_helper/bats-assert/src/assert_equal.bash, line 40,
# in test file test/ownership.bats, line 23)
# `assert_equal "$(stat -c %u file-from-denv)" "$(id -u ${USER})"' failed
# stat: illegal option -- c
# usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file ...]
#
# -- values do not equal --
# expected : 501
# actual :
# --
I get the same errors shown above using colima
and docker
instead of the setup-docker-macos action.
brew install colima docker
colima start
./ci/test docker
Edit: which makes sense since the action is just a wrapper around setting up colima with more well tuned settings for the runner environment.
Currently, I have templated out MacOS testing within the testing workflow.
https://github.com/tomeichlersmith/denv/blob/80efb6d764f1d41c23718da54e1e7c21ed83a344/.github/workflows/test.yml#L63-L77
It is commented out due to a few complexities.
ro
at a special (root) location. This got around the issue of being unable to launch the container, but the tests still failed.