Skip to content

Commit

Permalink
test: use unpath
Browse files Browse the repository at this point in the history
  • Loading branch information
3v0k4 committed Jun 7, 2024
1 parent 883f671 commit bd7e73a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ruby:3.3

ARG IMAGE_MAGICK_VERSION=7.1.1-33
ARG UNPATH_VERSION=0.1.0

# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1
Expand All @@ -21,6 +22,10 @@ RUN apt-get update && apt-get install -y \
libvips-tools && \
rm -rf /var/lib/apt/lists/*

RUN curl --location https://github.com/3v0k4/unpath/releases/download/v$UNPATH_VERSION/unpath-linux-amd64 --output unpath && \
chmod +x unpath && \
mv unpath /usr/local/sbin

WORKDIR /usr/src/app

COPY lib/favicon_factory/version.rb ./lib/favicon_factory/version.rb
Expand Down
8 changes: 3 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ namespace :test do
task :e2e do
require "open3"

unpath_vips = "unpath libvips unpath libvips-tools unpath vips"
statuses = [
["bin/rake test N=/e2e__with_deps/"],
["apt-get remove -y --purge libvips libvips-tools && bin/rake test N=/e2e__with_deps/"],
["#{unpath_vips} bin/rake test N=/e2e__with_deps/"],
["apt-get remove -y --purge *imagemagick* inkscape libvips libvips-tools && bin/rake test N=/e2e__without_deps/"],
[
"apt-get remove -y --purge libvips libvips-tools && bin/rake test N=/e2e__with_deps/",
"--build-arg IMAGE_MAGICK_VERSION=6.9.13-11"
]
["#{unpath_vips} bin/rake test N=/e2e__with_deps/", "--build-arg IMAGE_MAGICK_VERSION=6.9.13-11"]
].map do |command, build_args|
command = "docker run $(docker build -q #{build_args} .) bash -c '#{command}'"
stdout, stderr, status = Open3.capture3(command)
Expand Down

0 comments on commit bd7e73a

Please sign in to comment.