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
Failing tar tests #5212
Comments
I have updated the "Steps to Reproduce" with steps from "master". |
Expecting that this is the same issues as #5004. Although tbh these tests should probably be moved over to using |
Thank you for the suggestion @Rugvip , but @wyattwalter's suggestion to mount "/tmp" as a volume for the other issue did not work for me in this scenario. The tests seem to be using 👉🏻 I modified the dockerized test command to include a volume mount for "/tmp" and the tests still fail. I also tried creating a new "/tmp" directory inside of the "Dockerfile" before it is mounted as the working directory during initial setup. ("/app" is the working directory when the tests run.) Out of curiosity, I tried installing the
Partial Test Log
|
I believe I have found the area of the code issue, but not the root cause. In the failing "TarArchiveResponse.test.ts" test.
The line Now, if I call However, if I run *Note: you cannot run both |
@Rugvip and @OrkoHunter, based on the above ☝🏻 discovery, I think either |
TIP: To reproduce locally, I cloned "master" and added the following make target to the contrib makefile in order to make the testing cycle much faster. The initial docker container build and package dependencies will still take a moment.
With this new target, you can |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@ericis I have spent some time over the past few days encountering problems running these tests inside a Docker container myself. I discovered that they fail any time they are run as root. The 'entire archive' test exercises the extraction of this fixture, which contains at its base a directory belonging to UID 501: $ tar --numeric-owner -tzvf packages/backend-common/src/reading/__fixtures__/mock-main.tar.gz
drwxr-xr-x 0 501 20 0 27 Oct 2020 mock-main/
-rw-r--r-- 0 501 20 16 27 Oct 2020 mock-main/mkdocs.yml
drwxr-xr-x 0 501 20 0 27 Oct 2020 mock-main/docs/
-rw-r--r-- 0 501 20 7 27 Oct 2020 mock-main/docs/index.md when the process UID of the test is 0, then in this [side note: I believe this is a bug in node-tar, because the equivalent Anyway, that's not a problem until later on, when the nested So mock-fs is given the instruction to create a directory inside the tempdir (which is owned by UID 501) -- first thing it checks to see if it has write access. It notices that the current process doesn't own the file, so this check fails and we fall into this branch. Zooming out a bit, this parent directory was actually created/managed by mock-fs in the first place, when it intercepted this [Another side note, less carefully considered: is this a bug in mock-fs? I vaguely thought root should be able to write any directory...] So the mkdir call fails silently, since we're using the "streaming" version of I can think of three possible workaround here:
|
Thanks @jamieklassen . This is fantastic detail! I will look into converting the developer docker walk through to use rootless docker images or at least mention in the documentation that they should run rootless. |
@benjdlambert I saw you most recently helped merge some of the changes related to these failing tests. Maybe you know who might be able to help debug the issue.
Expected Behavior
Tests should pass.
Current Behavior
Tests failing for:
Possible Solution
It seems the tests are using a mock file system? If this is working properly, then no suggestions for a solution yet. Alpine works a little differently, so, if it is using the physical "/tmp" directory, then it could be an FS issue somehow. There is a
subpath
check inTarArchiveResponse.dir(...)
that is returningfalse
on occasion that could point to the culprit. See log below for more details.Steps to Reproduce
If you have Docker or Podman installed, you can clone "master" and follow these steps:
https://github.com/backstage/backstage/tree/master/contrib/docker/devops#prerequisites
However, you will need to explicitly run
make check-tests
as the tests are excluded from the defaultmake
target because of this bug.The above steps locally relate to an Alpine docker image running
root
, where a couple of tests that use the file system under "/tmp" fail.yarn install
yarn tsc
yarn build
yarn test
*I will finalize the docker image I am using in a PR to share with you, so that you can execute the exact same tasks.
Context
Here is the log output. I added some
console.log(...)
statements with "TEMP TEST FILE" to see what thetar.extract(... filter => ( ... ))
was doing.Your Environment
The text was updated successfully, but these errors were encountered: