|
37 | 37 | @click.option( |
38 | 38 | 'username', '--pact-broker-username', |
39 | 39 | envvar='PACT_BROKER_USERNAME', |
40 | | - help='Username for Pact Broker basic authentication.') |
| 40 | + help='Username for Pact Broker basic authentication. Can also be specified' |
| 41 | + ' via the environment variable PACT_BROKER_USERNAME.') |
41 | 42 | @click.option( |
42 | 43 | 'broker_base_url', '--pact-broker-url', |
43 | 44 | default='', |
44 | 45 | envvar='PACT_BROKER_BASE_URL', |
45 | | - help='Base URl for the Pact Broker instance to publish pacts to.') |
| 46 | + help='Base URl for the Pact Broker instance to publish pacts to. Can also be specified' |
| 47 | + ' via the environment variable PACT_BROKER_BASE_URL.') |
46 | 48 | @click.option( |
47 | 49 | 'consumer_version_tag', '--consumer-version-tag', |
48 | 50 | default='', |
49 | 51 | multiple=True, |
50 | 52 | help='Retrieve the latest pacts with this consumer version tag. ' |
51 | | - 'Used in conjunction with --provider.') |
| 53 | + 'Used in conjunction with --provider. May be specified multiple times.') |
| 54 | +@click.option( |
| 55 | + 'consumer_version_selector', '--consumer-version-selector', |
| 56 | + default='', |
| 57 | + multiple=True, |
| 58 | + help='Retrieve the latest pacts with this consumer version selector. ' |
| 59 | + 'Used in conjunction with --provider. May be specified multiple times.') |
52 | 60 | @click.option( |
53 | 61 | 'provider_version_tag', '--provider-version-tag', |
54 | 62 | default='', |
|
59 | 67 | 'password', '--pact-broker-password', |
60 | 68 | envvar='PACT_BROKER_PASSWORD', |
61 | 69 | help='Password for Pact Broker basic authentication. Can also be specified' |
62 | | - ' via the environment variable PACT_BROKER_PASSWORD') |
| 70 | + ' via the environment variable PACT_BROKER_PASSWORD.') |
63 | 71 | @click.option( |
64 | 72 | 'token', '--pact-broker-token', |
65 | 73 | envvar='PACT_BROKER_TOKEN', |
66 | 74 | help='Bearer token for Pact Broker authentication. Can also be specified' |
67 | | - ' via the environment variable PACT_BROKER_TOKEN') |
| 75 | + ' via the environment variable PACT_BROKER_TOKEN.') |
68 | 76 | @click.option( |
69 | 77 | 'provider', '--provider', |
70 | 78 | default='', |
71 | | - help='Retrieve the latest pacts for this provider') |
| 79 | + help='Retrieve the latest pacts for this provider.') |
72 | 80 | @click.option( |
73 | 81 | 'headers', '--custom-provider-header', |
74 | 82 | envvar='CUSTOM_PROVIDER_HEADER', |
|
80 | 88 | @click.option( |
81 | 89 | 'timeout', '-t', '--timeout', |
82 | 90 | default=30, |
83 | | - help='The duration in seconds we should wait to confirm verification' |
| 91 | + help='The duration in seconds we should wait to confirm that the verification' |
84 | 92 | ' process was successful. Defaults to 30.', |
85 | 93 | type=int) |
86 | 94 | @click.option( |
87 | 95 | 'provider_app_version', '-a', '--provider-app-version', |
88 | | - help='The provider application version, ' |
89 | | - 'required for publishing verification results') |
| 96 | + help='The provider application version. ' |
| 97 | + 'Required for publishing verification results.') |
90 | 98 | @click.option( |
91 | 99 | 'publish_verification_results', '-r', '--publish-verification-results', |
92 | 100 | default=False, |
93 | | - help='Publish verification results to the broker', |
| 101 | + help='Publish verification results to the broker.', |
94 | 102 | is_flag=True) |
95 | 103 | @click.option( |
96 | 104 | '--verbose/--no-verbose', |
|
107 | 115 | 'log_level', '--log-level', |
108 | 116 | help='The logging level.') |
109 | 117 | def main(pacts, base_url, pact_url, pact_urls, states_url, states_setup_url, |
110 | | - username, broker_base_url, consumer_version_tag, provider_version_tag, |
111 | | - password, token, provider, headers, timeout, provider_app_version, |
112 | | - publish_verification_results, verbose, log_dir, log_level): |
| 118 | + username, broker_base_url, consumer_version_tag, consumer_version_selector, |
| 119 | + provider_version_tag, password, token, provider, headers, timeout, |
| 120 | + provider_app_version, publish_verification_results, verbose, log_dir, log_level): |
113 | 121 | """ |
114 | 122 | Verify one or more contracts against a provider service. |
115 | 123 |
|
@@ -162,6 +170,7 @@ def main(pacts, base_url, pact_url, pact_urls, states_url, states_setup_url, |
162 | 170 | 'timeout': timeout, |
163 | 171 | 'verbose': verbose, |
164 | 172 | 'consumer_tags': list(consumer_version_tag), |
| 173 | + 'consumer_selectors': list(consumer_version_selector), |
165 | 174 | 'provider_tags': list(provider_version_tag), |
166 | 175 | 'provider_states_setup_url': states_setup_url |
167 | 176 | } |
|
0 commit comments