Skip to content
Permalink
Browse files

Use the current pyfakefs branch in docker file

- still defaults to master if docker is build without arguments
  • Loading branch information...
mrbean-bremen committed Jun 8, 2019
1 parent 99f7a66 commit 658953792b0810eadb281daf3af0cba06f432bea
Showing with 12 additions and 9 deletions.
  1. +3 −1 .travis/docker_tests.sh
  2. +7 −6 Dockerfile
  3. +2 −2 pyfakefs/tests/fake_os_test.py
@@ -3,6 +3,8 @@
if [[ $VM == 'Docker' ]]; then
echo "Running tests in Docker image"
echo "============================="
docker build -t pyfakefs .
export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
export REPO_SLUG=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_REPO_SLUG; else echo $TRAVIS_PULL_REQUEST_SLUG; fi)
docker build -t pyfakefs . --build-arg github_repo=$REPO_SLUG --build-arg github_branch=$BRANCH
docker run -t pyfakefs
fi
@@ -32,6 +32,8 @@ RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ARG github_repo=jmcgeheeiv/pyfakefs
ARG github_branch=master

RUN apt-get update && apt-get install -y \
python3-pip \
@@ -41,14 +43,13 @@ RUN apt-get clean

RUN useradd -u 1000 pyfakefs

RUN wget https://github.com/jmcgeheeiv/pyfakefs/archive/master.zip \
&& unzip master.zip \
&& chown -R pyfakefs:pyfakefs /pyfakefs-master
WORKDIR /pyfakefs-master
RUN wget https://github.com/$github_repo/archive/$github_branch.zip \
&& unzip $github_branch.zip \
&& chown -R pyfakefs:pyfakefs /pyfakefs-$github_branch
WORKDIR /pyfakefs-$github_branch
RUN pip3 install -r requirements.txt
RUN pip3 install -r extra_requirements.txt

USER pyfakefs
ENV PYTHONPATH /pyfakefs-master
ENV PYTHONPATH /pyfakefs-$github_branch
CMD ["python3", "-m", "pyfakefs.tests.all_tests"]

@@ -1047,7 +1047,7 @@ def test_rename_to_a_hardlink_of_same_file_should_do_nothing(self):
self.assertTrue(self.os.path.exists(link_path))

def test_hardlink_works_with_symlink(self):
self.check_posix_only()
self.skip_if_symlink_not_supported()
base_path = self.make_path('foo')
self.create_dir(base_path)
symlink_path = self.os.path.join(base_path, 'slink')
@@ -3216,7 +3216,7 @@ def test_stat_with_mixed_case(self):
self.os.stat(path)

def test_hardlink_works_with_symlink(self):
self.check_posix_only()
self.skip_if_symlink_not_supported()
base_path = self.make_path('foo')
self.create_dir(base_path)
symlink_path = self.os.path.join(base_path, 'slink')

0 comments on commit 6589537

Please sign in to comment.
You can’t perform that action at this time.