Skip to content

Commit be242ba

Browse files
authored
Merge pull request docker-library#19545 from J0WI/cleanup-legacy-tests
Cleanup legacy test cases
2 parents 61b0770 + 556469c commit be242ba

File tree

3 files changed

+2
-39
lines changed

3 files changed

+2
-39
lines changed

test/tests/php-argon2/container.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,4 @@
11
<?php
2-
if (file_exists('/etc/alpine-release')) {
3-
if (version_compare(file_get_contents('/etc/alpine-release'), '3.8.0') < 0) {
4-
echo "Skipping test; Alpine < 3.8";
5-
exit(0);
6-
}
7-
}
8-
else if (file_exists('/etc/debian_version')) {
9-
if (version_compare(file_get_contents('/etc/debian_version'), '9.0') < 0) {
10-
echo "Skipping test; Debian < 9.0";
11-
exit(0);
12-
}
13-
}
14-
else {
15-
echo "FAIL: Unknown base image (neither /etc/alpine-release nor /etc/debian_version exists).\n";
16-
exit(1);
17-
}
18-
19-
if (version_compare(PHP_VERSION, '7.2.0') < 0) {
20-
echo "Skipping test; PHP < 7.2";
21-
exit(0);
22-
}
23-
242
if (!defined('PASSWORD_ARGON2I')) {
253
echo "FAIL: Constant PASSWORD_ARGON2I is not defined.\n";
264
exit(1);

test/tests/ruby-bundler/container.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,5 @@ cp Gemfile.lock Gemfile.lock.orig
1313
BUNDLE_FROZEN=1 bundle install
1414
diff -u Gemfile.lock.orig Gemfile.lock >&2
1515

16-
if ruby -rbundler -e 'exit Gem::Version.new(Bundler::VERSION) >= Gem::Version.new("2.1") ? 0 : 1'; then
17-
BUNDLE_DEPLOYMENT=1 bundle install
18-
else
19-
bundle install --deployment
20-
fi
16+
bundle install --deployment
2117
diff -u Gemfile.lock.orig Gemfile.lock >&2

test/tests/ruby-gems/container.sh

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,11 @@ gems="$(ruby -e '
2020
require "json"
2121
require "open-uri"
2222
23-
# https://github.com/ruby/ruby/commit/05aac90a1bcfeb180f5e78ea8b00a4d1b04d5eed
24-
# https://bugs.ruby-lang.org/issues/15893
25-
# for Ruby 2.5+, we should use "URI.open", but for Ruby 2.4 we still need to use "open(...)" directly
26-
def openURI(uri)
27-
if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create("2.5")
28-
URI.open(uri)
29-
else
30-
open(uri)
31-
end
32-
end
33-
3423
for gem in gems
3524
# ruby 2.2.2+: rack activesupport
3625
# ruby 2.0+: mime-types
3726
# (jruby 1.7 is ruby 1.9)
38-
gemRubyVersion = JSON.load(openURI("https://rubygems.org/api/v1/versions/#{ gem }.json"))[0]["ruby_version"]
27+
gemRubyVersion = JSON.load(URI.open("https://rubygems.org/api/v1/versions/#{ gem }.json"))[0]["ruby_version"]
3928
if Gem::Dependency.new("", gemRubyVersion).match?("", RUBY_VERSION)
4029
puts gem
4130
else

0 commit comments

Comments
 (0)