Skip to content

Commit

Permalink
bat-test.dockerfile: make tests/source a volume
Browse files Browse the repository at this point in the history
Takes out a moving part so the probability of image layer cache
invalidation (and so `bat cache --build`) decreases.

It only depends on the syntax now. And the bat version.
  • Loading branch information
victor-gp committed Jul 9, 2022
1 parent 310d732 commit 1d6f276
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
*
!/syntaxes/
!/tests/docker/*regression.sh
!/tests/source
1 change: 0 additions & 1 deletion tests/docker/bat-test.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ COPY --from=fetch-pkg /tmp/bat.deb /tmp
RUN dpkg --install /tmp/bat.deb
ENV COLORTERM=truecolor
COPY ./tests/docker/*regression.sh /tests/
COPY ./tests/source /tests/source
COPY ./syntaxes/cmd-help.sublime-syntax /root/.config/bat/syntaxes/
RUN bat cache --build > /dev/null
ENTRYPOINT /tests/run_highlight_regression.sh
7 changes: 5 additions & 2 deletions tests/highlight_regression.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ cd "$(dirname "${BASH_SOURCE[0]}")"

docker build --quiet -f docker/bat-test.dockerfile -t bat-test ..

volume="$PWD"/highlighted:/tests/highlighted
docker run -v "$volume" bat-test
vol1="$PWD"/source:/tests/source:ro
vol2="$PWD"/highlighted:/tests/highlighted
docker run \
-v "$vol1" -v "$vol2" \
bat-test

# have git tell the effective difference between the version of the syntax
# in staging/HEAD and the one in working dir, for all highlighted samples
Expand Down
6 changes: 4 additions & 2 deletions tests/theme_regression.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ cd "$(dirname "${BASH_SOURCE[0]}")"

docker build --quiet -f docker/bat-test.dockerfile -t bat-test ..

volume="$PWD"/theme:/tests/theme
docker run -v "$volume" \
vol1="$PWD"/source:/tests/source:ro
vol2="$PWD"/theme:/tests/theme
docker run \
-v "$vol1" -v "$vol2" \
--entrypoint /tests/run_theme_regression.sh \
bat-test

Expand Down

0 comments on commit 1d6f276

Please sign in to comment.