Hey all :slightly_smiling_face: very new to Pact b...
# pact-js
c
Hey all 🙂 very new to Pact but really loving it so far - I am using it to the test the relation between an Express front end app and a Java backend. I have encountered a bit of a blocker when trying to run the consumer (express app) tests inside a Docker container, using Node 16 Debian based image, as the test time out. They run fine locally - I am thinking it is something wrong with how I set up the image, so I was wondering if there is anyone out here that has successfully run pact consumer tests in a Docker container with Node16 and would be willing to share how they set up their Dockerfile / or any tips? docker nodejs thanks
👋 2
m
Can you share a little bit more about your setup? It should be able to run in Docker. Have you tried setting the log level to debug or trace and see if they help provide any additional info?
c
Hey @Matt (pactflow.io / pact-js / pact-go) - thank you so much for the response. This is the repo This is the docker-compose file This is an example of the pact test Bit of a long one, but here is the journey so far: • first attempt was with a standard build of Node16 image, but I encountered the issue described in this thread - Following the set up in the pact docs for Docker didn't help (still had the error :
Error: Error while installing binary: Cannot find binary for platform 'linux' with architecture 'arm64'
. when running the pact test), so did a temp fix for this by building for specific platform (linux/AMD64). I am using M1 Apple Chip with Sierra 13 • I have actually now got passed the time out issue (just having a silly long timeout value), but I am getting a 401 Unauthorized error, seemingly when sending the request to the pact mock provider. I am investigating this Any help with even just the first point would be great 😄 , as I am thinking I am most likely doing something wrong as the issue was resolved judging by the github thread. Thank you again for responding
m
Yep, so the first point is as you say. You’ll need to set the platform flag (
--platform linux/amd64
) on docker. We don’t currently have binaries that will run on arm/linux, hence the install issue.
c
ahhh, okay. That helps a lot actually 🙂 Second point is now solved. Thanks again!
🙌 1