Skip to content

Commit 8085be0

Browse files
authored
feat: No include pending (#284)
* feat: Including new option to disable pending pacts
1 parent f169f3b commit 8085be0

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

pact/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Pact version info."""
22

3-
__version__ = '1.4.6'
3+
__version__ = '1.5.0'

pact/cli/verify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
'log_level', '--log-level',
112112
help='The logging level.')
113113
@click.option(
114-
'enable_pending', '--enable-pending',
114+
'enable_pending', '--enable-pending/--no-enable-pending',
115115
default=False,
116116
help='Allow pacts which are in pending state to be verified without causing the '
117117
'overall task to fail. For more information, see https://pact.io/pending',

pact/verify_wrapper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,13 @@ def call_verify(
170170

171171
if(kwargs.get('verbose', False) is True):
172172
command.extend(['--verbose'])
173+
173174
if enable_pending:
174175
command.append('--enable-pending')
175176

177+
else:
178+
command.append('--no-enable-pending')
179+
176180
if include_wip_pacts_since:
177181
command.extend(['--include-wip-pacts-since={}'.format(include_wip_pacts_since)])
178182

tests/test_verify_wrapper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def setUp(self):
4040
self.default_call = [
4141
'./pacts/consumer-provider.json',
4242
'./pacts/consumer-provider2.json',
43+
'--no-enable-pending',
4344
'--provider=test_provider',
4445
'--provider-base-url=http://localhost']
4546

@@ -52,6 +53,7 @@ def setUp(self):
5253
'--broker-token=token',
5354
'--consumer-version-tag=prod',
5455
'--consumer-version-tag=dev',
56+
'--no-enable-pending',
5557
'--provider-version-tag=dev',
5658
'--provider-version-tag=qa']
5759

@@ -85,9 +87,10 @@ def test_broker_without_authentication_can_be_used(self):
8587
provider='provider', provider_base_url='http://localhost', broker_url='http://broker.example.com'
8688
)
8789
self.assertProcess(*[
90+
'--no-enable-pending',
91+
'--pact-broker-base-url=http://broker.example.com',
8892
'--provider-base-url=http://localhost',
8993
'--provider=provider',
90-
'--pact-broker-base-url=http://broker.example.com',
9194
])
9295

9396
def test_pact_urls_provided(self):

0 commit comments

Comments
 (0)