Skip to content
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

Can't run tests locally using docker-compose #2919

Closed
Jamim opened this issue Oct 4, 2018 · 0 comments
Closed

Can't run tests locally using docker-compose #2919

Jamim opened this issue Oct 4, 2018 · 0 comments
Assignees
Labels
Category: Docker Issue affects docker builds. Category: Tests Relates to tests.

Comments

@Jamim
Copy link
Contributor

Jamim commented Oct 4, 2018

Preamble

As a software engineer, I'd like to be able to run pipenv's tests locally.
For me, the most convenient way to do so is to run docker-compose up.

Environment

I use Gentoo Linux on my laptop.

# uname -a
Linux irma-sun 4.18.11-gentoo #1 SMP Sun Sep 30 12:29:05 +03 2018 x86_64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz GenuineIntel GNU/Linux
# docker --version
Docker version 18.06.1-ce, build e68fc7a
# docker-compose --version
docker-compose version 1.22.0, build f46880f
Issue description

Trying to run tests on 2018-09-23 for the latest commit (for that moment, 7a696ce) of master branch of pipenv respository by executing docker-compose up, I found that it fails with the following error message:
FileNotFoundError: [Errno 2] No such file or directory: '/root/.local/share/virtualenvs'
The full log is here.

Expected result

Tests started and passed.

Actual result

Tests failed to start.

Steps to replicate

Since I found this bug it was "fixed" by #2877, but I believe it just masks the bug which is still there.
So, you basically have two options to reproduce the issue.

First option is to use latest master state and revert 65ccd76:

git checkout master
git pull origin master
git checkout -b tmp
git revert 65ccd765b6d0b78e602d4b233ca8e31e1a6b8adb
docker rm pipenv_pipenv-tests_1  # you must delete cached container
docker-compose up

Second options is to use 7a696ce commit:

git checkout -b tmp
git fetch
git reset 7a696ceb5ceafc9e4e338ce56798ac6aa43a1c01 --hard
docker rm pipenv_pipenv-tests_1  # you must delete cached container
docker-compose up
Solution

I tried to investigate this bug and found that it was introduced by #2513.
The root cause of the issue is that os.name != "nt" condition was mistakenly converted to fnmatch.fnmatch('A', 'a') when it should have been converted to not fnmatch.fnmatch('A', 'a').

I created a PR #2883 that fixes this issue.

Unluckily, there is one more bug to be fixed before you can run tests by docker-compose up.
There is a PR not-kennethreitz/pipenv-docker-tests#1 which fixes that bug as well.
Since it was not merged yet, I'm using 34d90b9 patch to avoid the bug.

@oz123 oz123 self-assigned this Sep 7, 2022
@oz123 oz123 added Category: Docker Issue affects docker builds. Category: Tests Relates to tests. labels Sep 7, 2022
@matteius matteius closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Docker Issue affects docker builds. Category: Tests Relates to tests.
Projects
None yet
Development

No branches or pull requests

3 participants