John Williams
07/05/2022, 11:59 PMCody Jenkins
07/06/2022, 7:19 AM$ yarn add @pact-foundation/pact-node@10.17.5
yarn add v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error /tmp/tmp.CovE6vLZ5q/node_modules/@pact-foundation/pact-node: Command failed.
Exit code: 1
Command: node postinstall.js
Arguments:
Directory: /tmp/tmp.CovE6vLZ5q/node_modules/@pact-foundation/pact-node
Output:
Installing Pact Standalone Binary for linux.
Downloading Pact Standalone Binary v1.89.02-rc1 for platform linux from <https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.89.02-rc1/pact-1.89.02-rc1-linux-x86_64.tar.gz>
Please note: we are tracking this download anonymously to gather important usage statistics. To disable tracking, set 'pact_do_not_track: true' in your package.json 'config' section.
Downloaded 26.57%...
Downloaded 84.62%...
Finished downloading binary to /tmp/tmp.CovE6vLZ5q/node_modules/@pact-foundation/pact-node/standalone/pact-1.89.02-rc1-linux-x86_64.tar.gz
Error: Error while installing binary: Postinstalled Failed Unexpectedly: Error: Error while installing binary: Checksum file missing from standalone directory. Aborting.
at throwError (/tmp/tmp.CovE6vLZ5q/node_modules/@pact-foundation/pact-node/standalone/install.js:42:11)
at /tmp/tmp.CovE6vLZ5q/node_modules/@pact-foundation/pact-node/standalone/install.js:327:16
at processTicksAndRejections (internal/process/task_queues.js:95:5)
info Visit <https://yarnpkg.com/en/docs/cli/add> for documentation about this command.
Billal
07/06/2022, 10:44 AMNo pacts were found for the consumer versions selected
- This is totally fine however, the job still passes. Is there a way to make it fail in such cases? Once again, apologies if this is in the wrong place 🙂Harris Lee
07/07/2022, 4:18 AMGLIBC_2.25
version complaints from node-14,16:slim
docker image for pact v3 beta
?Cody Jenkins
07/07/2022, 7:38 AM@pact-foundation/pact
version 9.18.1
. My provider tests are failing because the incoming request body is being mangled. Rather then sending through this:
{
"foo": "bar"
}
it's sending through this:
{
"{\"foo\":\"bar\"}": ""
}
This happens in 9.18.1
but not 9.17.3
.
I have to stop for the day but I can provide more details on this tomorrow (including pacts and more detail on what versions are affected). I thought at least posting this might jog someone's memory about somethingPrasad
07/07/2022, 4:07 PMAbdurahman Hijazi
07/07/2022, 4:19 PMPrasad
07/08/2022, 9:08 AMAlexandre
07/08/2022, 2:23 PM{
"consumer": {
"name": "pactflow-example-bi-directional-consumer-mountebank"
},
"provider": {
"name": "pactflow-example-bi-directional-provider-dredd"
},
"interactions": [],
"metadata": {
"pactSpecification": {
"version": "2.0.0"
}
}
}
Do you know how to fix ? 🙂json
07/08/2022, 9:01 PMHarris Lee
07/11/2022, 2:08 AMstateHandler
, we will use real provider side API to generate data, however, when stateHandler is failed, it does not execute the other tests, what is good practice workaround in here? for example, some verifier from provider side doesnt need stateHandler, if state handler somehow error/fail, shall we execute rest of them? any good tip for jest setup for provider? we use jest-each
to loop all contract in provider side.
each(needToBeVerified).it('should verify the expectations of %p Graphql', contractName => {
return new Verifier(createOptions(`${contractName}-provider`)).verifyProvider().then(output => {
if (output.includes('Diff')) {
console.log(output)
throw new Error(`${contractName} contract test error`)
}
})
Harris Lee
07/13/2022, 1:44 AMv3
config,
publishVerificationResult: true
it seems even we set false
it always pushed to the pactflow(broker) is that known issue? or only me lol ?Ravindra Dhaka
07/13/2022, 3:50 PMNoor Hashem
07/13/2022, 5:39 PMMarcello Rigan
07/19/2022, 1:33 PMHarris Lee
07/20/2022, 12:32 AMpact v3 node 18 slim
container? It kept getting memory issue from 2gb so I had bumped up to 4gb, but still get some issues.
I did not face any issue with pact v2 with node 14 slim
from 2gb memory, all tests are running passed but getting memory error
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xb65a10 node::Abort() [/usr/local/bin/node]
2: 0xa761b5 node::FatalError(char const*, char const*) [/usr/local/bin/node]
3: 0xd5713e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
4: 0xd574b7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
5: 0xf34545 [/usr/local/bin/node]
6: 0xf35448 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/local/bin/node]
7: 0xf45953 [/usr/local/bin/node]
8: 0xf467c8 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
9: 0xf2112e v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
10: 0xf224f7 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
11: 0xf02a40 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/usr/local/bin/node]
12: 0xefa4b4 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [/usr/local/bin/node]
13: 0xefc768 v8::internal::FactoryBase<v8::internal::Factory>::NewRawOneByteString(int, v8::internal::AllocationType) [/usr/local/bin/node]
14: 0xf05d2d v8::internal::Factory::NewStringFromUtf8(v8::base::Vector<char const> const&, v8::internal::AllocationType) [/usr/local/bin/node]
15: 0xd661a3 v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int) [/usr/local/bin/node]
16: 0xbba616 v8::MaybeLocal<v8::Value> node::ToV8Value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(v8::Local<v8::Context>, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, v8::Isolate*) [/usr/local/bin/node]
17: 0xc0f4b5 [/usr/local/bin/node]
18: 0xc1597a [/usr/local/bin/node]
19: 0x167e06f [/usr/local/bin/node]
Aborted (core dumped)
so I bumped up memory to 4gb but it still sometimes got error
spawn ENOMEM
at spawn (node_modules/cross-spawn/index.js:12:24)
at Spawn.Object.<anonymous>.Spawn.spawnBinary (node_modules/@pact-foundation/pact-core/src/spawn/spawn.ts:46:22)
at Server.Object.<anonymous>.AbstractService.spawnBinary (node_modules/@pact-foundation/pact-core/src/service.ts:245:18)
at Server.Object.<anonymous>.AbstractService.start (node_modules/@pact-foundation/pact-core/src/service.ts:165:28)
at node_modules/@pact-foundation/src/httpPact/index.ts:277:19
at Pact.Object.<anonymous>.Pact.startServer (node_modules/@pact-foundation/src/httpPact/index.ts:276:12)
at node_modules/@pact-foundation/src/httpPact/index.ts:94:24
The pact mock service wasn't running when verify was called
at Pact.Object.<anonymous>.Pact.verify (node_modules/@pact-foundation/src/httpPact/index.ts:145:9)
at Object.<anonymous> (node_modules/jest-pact/index.js:26:45)
anyone had same issue?json
07/20/2022, 7:41 PMid: "ce118b6e-d8e1-11e7-9296-cec278b6b50a"
to
id: Matchers.uuid("ce118b6e-d8e1-11e7-9296-cec278b6b50a")
I am now getting:
Object {
- "id": Object {
- "data": Object {
- "generate": "ce118b6e-d8e1-11e7-9296-cec278b6b50a",
- "matcher": Object {
- "json_class": "Regexp",
- "o": 0,
- "s": "^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$",
- },
- },
- "getValue": [Function getValue],
- "json_class": "Pact::Term",
- },
+ "id": "ce118b6e-d8e1-11e7-9296-cec278b6b50a",
}
> 92 | expect(response).toEqual(responseData)
| ^
This is all inside a pactWith
block, because this is using the jest-pact library.MiKey
07/20/2022, 9:03 PMHeader:
Content-Type: Expected a header 'Content-Type' but was missing
Body:
Expected a response type of 'application/json' but the actual type was 'null'
I have verified that the header is in the contract on the consumer, and that the provider is producing a content-type...any insight what might be going on here?Zhaopeng XUAN
07/22/2022, 8:34 AMHarley Thomas
07/23/2022, 2:22 AMwithRequest
with a header that is calculated at run time, but then my actual application code executes a second or two later, and generates a slightly different header since the time is off by a second or two.
I tried to use Matchers, but then those matches get sent to my provider within provider verification and fail since it is a malformed header and the service denies the request.
Is there a workaround here? Can I specify a Matcher within withRequest
but use the actual header from the application code to verify against the provider?
New to pactflow and contract testing in general so apologies in advance! Any help would be greatly appreciated.Yair Shkedi
07/25/2022, 9:21 PMYair Shkedi
07/25/2022, 9:21 PMYair Shkedi
07/25/2022, 9:22 PMYair Shkedi
07/25/2022, 9:22 PMYair Shkedi
07/25/2022, 9:22 PMHarris Lee
07/27/2022, 12:14 AMThe property 'all' is not a valid property of ConsumerVersionSelector. Allowed properties are tag, latest, consumer, deployedOrReleased, deployed, released, environment, fallbackTag, branch, mainBranch, matchingBranch)
after I update to v3, I got this message, can I get some guideline please?Harris Lee
07/27/2022, 5:44 AMhas status code 200 (OK)
includes headers
"Content-Type" with value "application/json" (OK)
has a matching body (OK)
then failure
1.1) has a matching body
expected 'application/json;charset=utf-8' body but was 'application/json'
1.2) includes header 'Content-Type' with value 'application/json; charset=utf-8'
Expected header 'Content-Type' to have value 'application/json; charset=utf-8' but was 'application/json'
I am little bit confused. lol
consumer pact response and request headers are
"headers": {
"Content-Type": "application/json"
},
Harris Lee
07/27/2022, 5:46 AMAlan Boshier
07/27/2022, 8:18 AM[2022-07-27T08:00:39Z INFO pact_mock_server::hyper_server] Received request HTTP Request ( method: GET, path: /foo/1/bar, query: None, headers: Some({"accept": ["application/json"], "authorization": ["Bearer undefined"], "user-agent": ["node-fetch/1.0 (+<https://github.com/bitinn/node-fetch>)"], "accept-encoding": ["gzip", "deflate"], "connection": ["close"], "host": ["127.0.0.1:52198"]}), body: Empty )
[2022-07-27T08:00:39Z INFO pact_matching] comparing to expected HTTP Request ( method: GET, path: /fooBlah/1/bar, query: None, headers: Some({"Accept": ["application/json"]}), body: Missing )
[2022-07-27T08:00:39Z INFO pact_mock_server::hyper_server] Request matched, sending response HTTP Response ( status: 200, headers: Some({"Content-Type": ["application/json"]}), body: Present(266 bytes, application/json) )
I'm looking for strings like comparing to expected HTTP Request
in the pact and pact-core codebase but not having any luck - could someone point me at where these are?
[Some GLIBC-related blockers prevent me moving to beta62 at this time]Alan Boshier
07/27/2022, 8:22 AMfromProviderState('/fooBlah/{id}/bar', '/fooBlah/1/bar')
when specifying a path matcher, as using a raw matcher causes the URL to not be matched (as expected)