You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: lib/pact_broker/pacts/verifiable_pact_messages.rb
+25-10
Original file line number
Diff line number
Diff line change
@@ -29,17 +29,14 @@ def inclusion_reason
29
29
# WIP pacts will always have tags, because it is part of the definition of being a WIP pact
30
30
"The pact at #{pact_version_url} is being verified because it is a 'work in progress' pact (ie. it is the pact for the latest #{version_text} of Foo tagged with #{joined_head_consumer_tags} and is still in pending state). #{READ_MORE_WIP}"
31
31
else
32
-
ifselectors.overall_latest?
33
-
"The pact at #{pact_version_url} is being verified because it is the latest pact between #{consumer_name} and #{provider_name}."
34
-
else
35
-
"The pact at #{pact_version_url} is being verified because it is the pact for the latest #{version_text} of Foo tagged with #{joined_head_consumer_tags}"
"The pact at #{pact_version_url} is being verified because it matches the following configured selection #{criteria_or_criterion}: #{selector_descriptions}#{same_content_note}"
37
34
end
38
35
end
39
36
40
37
defpending_reason
41
38
ifpending?
42
-
"This pact is in pending state because it has not yet been successfully verified by #{pending_provider_tags_description}. If this verification fails, it will not cause the overall build to fail. #{READ_MORE_PENDING}"
39
+
"This pact is in pending state for this version of #{provider_name} because a successful verification result for #{pending_provider_tags_description("a")} has not yet been published. If this verification fails, it will not cause the overall build to fail. #{READ_MORE_PENDING}"
43
40
else
44
41
"This pact has previously been successfully verified by #{non_pending_provider_tags_description}. If this verification fails, it will fail the build. #{READ_MORE_PENDING}"
its(:inclusion_reason){is_expected.toinclude"The pact at http://pact is being verified because it is the latest pact between Foo and Bar."}
32
+
its(:inclusion_reason){is_expected.toinclude"The pact at http://pact is being verified because it matches the following configured selection criterion: latest pact between a consumer and Bar"}
its(:inclusion_reason){is_expected.toinclude"The pact at http://pact is being verified because it is the pact for the latest version of Foo tagged with 'dev'"}
37
+
its(:inclusion_reason){is_expected.toinclude"The pact at http://pact is being verified because it matches the following configured selection criterion: latest pact for a consumer version tagged 'dev'"}
38
38
its(:pact_description){is_expected.toeq"Pact between Foo and Bar, consumer version 123, latest dev"}
its(:inclusion_reason){is_expected.toinclude"The pact at http://pact is being verified because it is the pact for the latest versions of Foo tagged with 'dev' and 'prod' (both have the same content)"}
43
+
its(:inclusion_reason){is_expected.toinclude"The pact at http://pact is being verified because it matches the following configured selection criteria: latest pact for a consumer version tagged 'dev', latest pact for a consumer version tagged 'prod' (both have the same content)"}
its(:inclusion_reason){is_expected.toinclude"The pact at http://pact is being verified because it is the pact for the latest versions of Foo tagged with 'dev', 'prod' and 'feat-x' (all have the same content)"}
48
+
its(:inclusion_reason){is_expected.toinclude" (all have the same content)"}
its(:inclusion_reason){is_expected.toinclude"The pact at http://pact is being verified because it is a 'work in progress' pact (ie. it is the pact for the latest version of Foo tagged with 'feat-x' and is still in pending state)."}
63
59
end
60
+
61
+
context"when the pact is one of all versions for a tag"do
its(:inclusion_reason){is_expected.toinclude"The pact at http://pact is being verified because it matches the following configured selection criterion: pacts for all consumer versions tagged 'prod'"}
65
+
end
64
66
end
65
67
66
68
describe"#pending_reason"do
@@ -81,20 +83,20 @@ module Pacts
81
83
82
84
context"when there are no pending_provider_tags"do
83
85
context"when there are no non_pending_provider_tags"do
84
-
its(:pending_reason){is_expected.toinclude"This pact is in pending state because it has not yet been successfully verified by Bar. If this verification fails, it will not cause the overall build to fail."}
86
+
its(:pending_reason){is_expected.toinclude"This pact is in pending state for this version of Bar because a successful verification result for Bar has not yet been published. If this verification fails, it will not cause the overall build to fail."}
85
87
end
86
88
end
87
89
88
90
context"when there is 1 pending_provider_tag"do
89
91
let(:pending_provider_tags){%w[dev]}
90
92
91
-
its(:pending_reason){is_expected.toinclude"This pact is in pending state because it has not yet been successfully verified by any version of Bar with tag 'dev'. If this verification fails, it will not cause the overall build to fail."}
93
+
its(:pending_reason){is_expected.toinclude"This pact is in pending state for this version of Bar because a successful verification result for a version of Bar with tag 'dev' has not yet been published. If this verification fails, it will not cause the overall build to fail."}
92
94
end
93
95
94
96
context"when there are 2 pending_provider_tags"do
95
97
let(:pending_provider_tags){%w[devfeat-x]}
96
98
97
-
its(:pending_reason){is_expected.toinclude"This pact is in pending state because it has not yet been successfully verified by any versions of Bar with tag 'dev' and 'feat-x'."}
99
+
its(:pending_reason){is_expected.toinclude"This pact is in pending state for this version of Bar because a successful verification result for a versions of Bar with tag 'dev' and 'feat-x' has not yet been published. If this verification fails, it will not cause the overall build to fail."}
0 commit comments