Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 840f601

Browse files
committed
Fixed integration tests
Integration tests should target the v2.4 image. Moreover, we should be testing the 2.7.1 registry. Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
1 parent e960c96 commit 840f601

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

app/policies/namespace_policy.rb

-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ def destroy?
5656
all_destroy?(force_non_global: true)
5757
end
5858

59-
alias delete? destroy?
60-
6159
def update?
6260
raise Pundit::NotAuthorizedError, "must be logged in" unless user
6361
(user.admin? || (APP_CONFIG.enabled?("user_permission.manage_namespace") &&

lib/portus/http_helpers.rb

+6-4
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ module HttpHelpers
1515
# Returns an URI object and a request object for the given path & method
1616
# pair.
1717
def get_request(path, method)
18-
uri = URI.join(@base_url, path)
19-
req = Net::HTTP.const_get(method.capitalize).new(uri)
20-
[uri, req]
18+
@uri = URI.join(@base_url, path)
19+
@method = method
20+
req = Net::HTTP.const_get(method.capitalize).new(@uri)
21+
[@uri, req]
2122
end
2223

2324
# This is the general method to perform an HTTP request to an endpoint
@@ -71,7 +72,8 @@ def safe_request(path, method = "get", request_auth_token = true)
7172
# response as given by the registry, and the params hash are extra arguments
7273
# that will be passed to the exception message.
7374
def handle_error(response, params = {})
74-
str = "\nCode: #{response.code}\n"
75+
str = "\nError on request: #{@method} #{@uri}\n" \
76+
"Code: #{response.code}\n"
7577

7678
# Add the errors as given by the registry.
7779
begin

lib/tasks/test/integration.rake

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ require "portus/test"
1414
# Images for the supported registry versions. These versions will be applied
1515
# through a cartesian product into the test matrix.
1616
SUPPORTED_REGISTRIES = [
17-
"library/registry:2.5",
18-
"library/registry:2.6"
17+
"library/registry:2.7.1"
1918
].freeze
2019

2120
PRODUCTION = [
2221
{
23-
background: "opensuse/portus:head",
24-
portus: "opensuse/portus:head"
22+
background: "opensuse/portus:2.4",
23+
portus: "opensuse/portus:2.4"
2524
}
2625
].freeze
2726

0 commit comments

Comments
 (0)