From 8a7f67d4d1db797b1a7c988eef9c5a32901d10b9 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Sat, 14 May 2022 09:11:44 -0400 Subject: [PATCH] test: make tests run without root access (#3968) --- .gitignore | 3 ++- docker/app.Dockerfile | 2 +- ietf/utils/test_runner.py | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index e69242f9c..5a7f3b627 100644 --- a/.gitignore +++ b/.gitignore @@ -53,8 +53,9 @@ datatracker.sublime-workspace /share /static /testresult +/.testresult /tmp -/tmp-nomcom-public-keys-dir +/tmp-* /trunk27 /trunk36 /trunk37 diff --git a/docker/app.Dockerfile b/docker/app.Dockerfile index 637fbafd3..e18c98aec 100644 --- a/docker/app.Dockerfile +++ b/docker/app.Dockerfile @@ -136,7 +136,7 @@ USER vscode:vscode # Install current datatracker python dependencies COPY requirements.txt /tmp/pip-tmp/ -RUN pip3 --disable-pip-version-check --no-cache-dir install --user -r /tmp/pip-tmp/requirements.txt +RUN pip3 --disable-pip-version-check --no-cache-dir install --user --no-warn-script-location -r /tmp/pip-tmp/requirements.txt RUN sudo rm -rf /tmp/pip-tmp # ENTRYPOINT [ "/docker-init.sh" ] diff --git a/ietf/utils/test_runner.py b/ietf/utils/test_runner.py index 200ce047c..ee3763f44 100644 --- a/ietf/utils/test_runner.py +++ b/ietf/utils/test_runner.py @@ -422,8 +422,7 @@ def save_test_results(failures, test_labels): # Record the test result in a file, in order to be able to check the # results and avoid re-running tests if we've alread run them with OK # result after the latest code changes: - topdir = os.path.dirname(os.path.dirname(settings.BASE_DIR)) - tfile = io.open(os.path.join(topdir,".testresult"), "a", encoding='utf-8') + tfile = io.open(".testresult", "a", encoding='utf-8') timestr = time.strftime("%Y-%m-%d %H:%M:%S") if failures: tfile.write("%s FAILED (failures=%s)\n" % (timestr, failures)) @@ -929,7 +928,7 @@ class IetfTestRunner(DiscoverRunner): testcase = TestCase() cwd = pathlib.Path.cwd() tmpdir = tempfile.TemporaryDirectory(prefix="html-validate-") - Path(tmpdir.name).chmod(0o655) + Path(tmpdir.name).chmod(0o777) for (name, content, fingerprint) in self.batches[kind]: path = pathlib.Path(tmpdir.name).joinpath( hex(fingerprint)[2:],