Closed handerss-spotfire closed 2 years ago
I ran the tests locally on macOS 12.5.1 and they passed. Not sure what the difference is between what I ran and macos-latest, 14.x.
So it turns out (I think) the problem was that the macos machine symlinks its temp directory. I was able to reproduce this on a linux machine by removing /tmp and symlinking something like /private/tmp to /tmp.
I added a fs.realpathSync to resolve the canonical path of the tmpdir, and this seems to solve the issue and makes the tests pass. Hopefully this also fixes the macos issue.
I also tested symlinking the repo dir before running the tests, and that seems to work fine.
Here's a Dockerfile in case someone else wants to reproduce:
from node:18.8.0
COPY karma-esbuild /karma-esbuild
WORKDIR /karma-esbuild
RUN apt-get update && apt-get install -y --no-install-recommends \
libgbm1 \
libdrm2 \
libxshmfence1 \
libgtk-3.0 \
libasound2 \
libxrandr2 \
libcups2\
libatk-bridge2.0-0 \
libnss3 && \
mkdir -p /private/tmp && \
rm -rf /tmp && \
ln -s /private/tmp /tmp && \
yarn install
ENTRYPOINT [ "yarn", "test" ]
/cc @marvinhagemeister
Well this explains my issues. I've temporarily fixed it by setting TEMP to a directory on the root of my drive.
Currently the file paths inserted into the bundle are incorrect since they are relative the entry point file as opposed to the temp dir. This actually works in the common case where the filesystem root is the most common relative folder (the erroneous additional
..
in the path can't walk up from root) but breaks for any other relative folder.Changing the path to be relative the temp directory as opposed to the entry point file fixes this.