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

Commit

Permalink
Fixed integration tests
Browse files Browse the repository at this point in the history
Integration tests should target the v2.4 image. Moreover, we should be testing
the 2.7.1 registry.

Signed-off-by: Miquel Sabaté Solà <[email protected]>
  • Loading branch information
mssola committed Jan 24, 2019
1 parent e960c96 commit 840f601
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 0 additions & 2 deletions app/policies/namespace_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ def destroy?
all_destroy?(force_non_global: true)
end

alias delete? destroy?

def update?
raise Pundit::NotAuthorizedError, "must be logged in" unless user
(user.admin? || (APP_CONFIG.enabled?("user_permission.manage_namespace") &&
Expand Down
10 changes: 6 additions & 4 deletions lib/portus/http_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ module HttpHelpers
# Returns an URI object and a request object for the given path & method
# pair.
def get_request(path, method)
uri = URI.join(@base_url, path)
req = Net::HTTP.const_get(method.capitalize).new(uri)
[uri, req]
@uri = URI.join(@base_url, path)
@method = method
req = Net::HTTP.const_get(method.capitalize).new(@uri)
[@uri, req]
end

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

# Add the errors as given by the registry.
begin
Expand Down
7 changes: 3 additions & 4 deletions lib/tasks/test/integration.rake
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ require "portus/test"
# Images for the supported registry versions. These versions will be applied
# through a cartesian product into the test matrix.
SUPPORTED_REGISTRIES = [
"library/registry:2.5",
"library/registry:2.6"
"library/registry:2.7.1"
].freeze

PRODUCTION = [
{
background: "opensuse/portus:head",
portus: "opensuse/portus:head"
background: "opensuse/portus:2.4",
portus: "opensuse/portus:2.4"
}
].freeze

Expand Down

0 comments on commit 840f601

Please sign in to comment.