Cleanup legacy test cases

This commit is contained in:
J0WI 2025-07-27 14:42:53 +02:00
parent 3af17bf404
commit 556469cfd3
3 changed files with 2 additions and 39 deletions

View File

@ -1,26 +1,4 @@
<?php
if (file_exists('/etc/alpine-release')) {
if (version_compare(file_get_contents('/etc/alpine-release'), '3.8.0') < 0) {
echo "Skipping test; Alpine < 3.8";
exit(0);
}
}
else if (file_exists('/etc/debian_version')) {
if (version_compare(file_get_contents('/etc/debian_version'), '9.0') < 0) {
echo "Skipping test; Debian < 9.0";
exit(0);
}
}
else {
echo "FAIL: Unknown base image (neither /etc/alpine-release nor /etc/debian_version exists).\n";
exit(1);
}
if (version_compare(PHP_VERSION, '7.2.0') < 0) {
echo "Skipping test; PHP < 7.2";
exit(0);
}
if (!defined('PASSWORD_ARGON2I')) {
echo "FAIL: Constant PASSWORD_ARGON2I is not defined.\n";
exit(1);

View File

@ -13,9 +13,5 @@ cp Gemfile.lock Gemfile.lock.orig
BUNDLE_FROZEN=1 bundle install
diff -u Gemfile.lock.orig Gemfile.lock >&2
if ruby -rbundler -e 'exit Gem::Version.new(Bundler::VERSION) >= Gem::Version.new("2.1") ? 0 : 1'; then
BUNDLE_DEPLOYMENT=1 bundle install
else
bundle install --deployment
fi
bundle install --deployment
diff -u Gemfile.lock.orig Gemfile.lock >&2

View File

@ -20,22 +20,11 @@ gems="$(ruby -e '
require "json"
require "open-uri"
# https://github.com/ruby/ruby/commit/05aac90a1bcfeb180f5e78ea8b00a4d1b04d5eed
# https://bugs.ruby-lang.org/issues/15893
# for Ruby 2.5+, we should use "URI.open", but for Ruby 2.4 we still need to use "open(...)" directly
def openURI(uri)
if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create("2.5")
URI.open(uri)
else
open(uri)
end
end
for gem in gems
# ruby 2.2.2+: rack activesupport
# ruby 2.0+: mime-types
# (jruby 1.7 is ruby 1.9)
gemRubyVersion = JSON.load(openURI("https://rubygems.org/api/v1/versions/#{ gem }.json"))[0]["ruby_version"]
gemRubyVersion = JSON.load(URI.open("https://rubygems.org/api/v1/versions/#{ gem }.json"))[0]["ruby_version"]
if Gem::Dependency.new("", gemRubyVersion).match?("", RUBY_VERSION)
puts gem
else