Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developer guide doesn't lead to a successful setup #390

Closed
2 of 5 tasks
TimothyJones opened this issue Aug 11, 2022 · 8 comments
Closed
2 of 5 tasks

Developer guide doesn't lead to a successful setup #390

TimothyJones opened this issue Aug 11, 2022 · 8 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@TimothyJones
Copy link
Contributor

Software versions

Please provide at least OS and version of pact-js

  • OS: Mac OS 11.6.4
  • Pact Core version: Pact core 13.7.2
  • Node Version: v17.6.0
  • Other Versions: Apple M1 chip

Issue Checklist

Please confirm the following:

  • I have upgraded to the latest
  • I have the read the FAQs in the Readme
  • I have triple checked, that there are no unhandled promises in my code
  • I have set my log level to debug and attached a log file showing the complete request/response cycle
  • For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem

Expected behaviour

A fresh checkout runs npm install successfully, as per the developer instructions. Then, the tests will pass.

Actual behaviour

(also there are no FAQs in the readme - but the checklist says to check them)

Fresh checkout fails to run npm install:

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/pact/native/addon.o
  CXX(target) Release/obj.target/pact/native/ffi.o
../native/ffi.cc:2:10: fatal error: 'pact-cpp.h' file not found
#include "pact-cpp.h"
         ^~~~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/pact/native/ffi.o] Error 1

After running ./script/download-libs.sh, then npm install succeeds, but if I do npm run test, then that fails too:

  1) FFI integration test for the HTTP Consumer API
       with binary data
         generates a pact with success:
     Error: Request failed with status code 500
      at createError (node_modules/axios/lib/core/createError.js:16:15)
      at settle (node_modules/axios/lib/core/settle.js:17:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:293:11)
      at IncomingMessage.emit (node:events:539:35)
      at IncomingMessage.emit (node:domain:475:12)
      at endReadableNT (node:internal/streams/readable:1342:12)
      at processTicksAndRejections (node:internal/process/task_queues:83:21)

Steps to reproduce

  1. Do fresh checkout
  2. Do npm install
  3. Observe that the install doesn't work
  4. Run ./scripts/download-libs.sh
  5. Run npm install and then npm run test
  6. Observe that the test run also failed

Relevant log files

Here's the failing part of the test run - no additional helpful output unfortunately:

  FFI integration test for the HTTP Consumer API
    with JSON data
      ✔ generates a pact with success
      ✔ generates a pact with failure
    with binary data
      1) generates a pact with success
    using a plugin (protobufs)
      - generates a pact with success
    with multipart data
[]
      ✔ generates a pact with success
@TimothyJones TimothyJones added the bug Indicates an unexpected problem or unintended behavior label Aug 11, 2022
@mefellows
Copy link
Member

Thanks, looks like we've managed to keep the chicken/egg problem going. I'll take a look today Tim!

@TimothyJones
Copy link
Contributor Author

TimothyJones commented Aug 12, 2022 via email

@YOU54F
Copy link
Member

YOU54F commented Sep 28, 2022

Just came across the same issue, with a similar spec machine (m1 mbp / node v16)

Thanks for your instructions, they managed to get me to the same state, which I have resolved at least for me for the time being

I can get the test to pass by changing the content type to application/octet-stream in both the pact expectation and the api client

there is currently a cross-platform workaround for windows platforms

it('generates a pact with success', () => {

pact-foundation/pact-reference#171

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2023

👋 Hi! The 'smartbear-supported' label has just been added to this issue, which will create an internal tracking ticket in PactFlow's Jira (PACT-789). We will use this to prioritise and assign a team member to this task. All activity will be public on this ticket. For now, sit tight and we'll update this ticket once we have more information on the next steps.

See our documentation for more information.

@YOU54F
Copy link
Member

YOU54F commented May 2, 2023

I've updated the developer guide as part of #444 to note that the developer needs to run the download scripts prior to running anything npm related in the repo, as they won't have anything in node_modules so no rimraf to do the clean step.

All the other step does is bash ./script/download-libs.sh so we can just tell a devvo to do that first :)

Also made it sure fries the ffi folder, as otherwise every time you ran npm run build it would ask you if you wanted to re-download the ffi, which is a pain, as the user has to interact. If I press y several times, my y alias for yarn install kicks in and it conflicts with the package-lock.json 😂

@YOU54F
Copy link
Member

YOU54F commented May 2, 2023

closed by #444

edit - I don't know if you can link issues to be closed this way, or if I need to put closes #xyz into the PR that will close the related issue

@YOU54F
Copy link
Member

YOU54F commented Jul 6, 2023

Updated again to reflect the process of prebuilds and ignore-scripts

@YOU54F
Copy link
Member

YOU54F commented Jun 12, 2024

I believe this is complete

@YOU54F YOU54F closed this as completed Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants