Skip to content

Commit

Permalink
fix: correct arguments for source with selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Feb 23, 2022
1 parent 2a4fa3e commit dd7ef00
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pact-foundation/pact-core",
"version": "13.4.1-beta.13",
"version": "13.4.1-beta.16",
"description": "Core of @pact-foundation/pact. You almost certainly don't want to depend on this directly.",
"main": "src/index.js",
"homepage": "https://github.com/pact-foundation/pact-js-core#readme",
Expand Down
1 change: 0 additions & 1 deletion src/ffi/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ export type Ffi = {
pactffiVerifierBrokerSourceWithSelectors(
handle: FfiVerifierHandle,
url: string,
providerName: string,
username: string,
password: string,
token: string,
Expand Down
8 changes: 8 additions & 0 deletions src/verifier/argumentMapper/arguments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,20 @@ export const ignoreOptionCombinations: IgnoreOptionCombinations<VerifierOptions>
};

export const argMapping: ArgMapping<InternalPactVerifierOptions> = {
buildUrl: { arg: '--build-url', mapper: 'string' },
providerBranch: { arg: '--provider-branch', mapper: 'string' },
providerBaseUrl: (providerBaseUrl: string) => {
const u = url.parse(providerBaseUrl);
return u && u.port && u.hostname
? ['--port', u.port, '--hostname', u.hostname]
: [];
},
providerStatesSetupBody: {
warningMessage: 'providerStatesSetupBody is not valid for the CLI',
},
providerStatesSetupTeardown: {
warningMessage: 'providerStatesSetupTeardown is not valid for the CLI',
},
logLevel: (logLevel: LogLevel) => ['--loglevel', logLevel],
provider: { arg: '--provider-name', mapper: 'string' },
pactUrls: (pactUrls: string[]) =>
Expand Down
5 changes: 4 additions & 1 deletion src/verifier/nativeVerifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export const verify = (opts: VerifierOptions): Promise<string> => {
ffi.pactffiVerifierBrokerSourceWithSelectors(
handle,
opts.pactBrokerUrl,
opts.provider,
opts.pactBrokerUsername || '',
opts.pactBrokerPassword || '',
opts.pactBrokerToken || '',
Expand All @@ -127,6 +126,10 @@ export const verify = (opts: VerifierOptions): Promise<string> => {
// Todo: probably separate out the sections of this logic into separate promises
return new Promise<string>((resolve, reject) => {
ffi.pactffiVerifierExecute(handle, (err: Error, res: number) => {
logger.debug(`shutting down verifier with handle ${handle}`);

ffi.pactffiVerifierShutdown(handle);

logger.debug(`response from verifier: ${err}, ${res}`);
if (err) {
if (typeof err === 'string') {
Expand Down

0 comments on commit dd7ef00

Please sign in to comment.