shavo007 / pact-demo

Demonstrate pact

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to generate pact file with jsConsumer

rjatling opened this issue · comments

tried to use your example to generate pact file with jsConsumer.
gulp task run ok, but it doesn't generate pact file.
when i manually put a pact file (generated from jvmConsumer) in pacts folder it publish the pact to the pact broker and pactverify works.

Not sure what I am missing. Any clues, really appreciate it.

Hi @rjatling ,

Whats the issue you get when running the test?

If you run gulp pact, it will generate the pact and publish to your local pact broker.

Verify that your node modules are correctly installed. I had an issue initially where the modules are not downloaded from the registry correctly.

Hi Shane,

Thanks for your quick reply. I am using eclipse IDE, I can see there are lots of error marks on the node Modules. However when i run gulp pact, it runs ok but doesn't generate pact files and neither does it publish in pact broker.

This is the first issue i encountered....below stacktrace

[15:40:07] Using gulpfile ~/Documents/Pact Workspace/pact_node_demo/jsConsumer/gulpfile.js
[15:40:07] Starting 'createPacts'...
[�[37m2016-08-16T05:40:12.958Z�[39m] �[35m WARN�[39m: pact-node@4.5.1/5482 on admins-MacBook-Pro-3.local: �[36mPact exited with code 1.�[39m
�[31m16 08 2016 15:40:12.960:ERROR [karma]: �[39m{ [Error: kill ESRCH] code: 'ESRCH', errno: 'ESRCH', syscall: 'kill' }
Error: kill ESRCH
at exports._errnoException (util.js:873:11)
at process.kill (node.js:777:15)
at Server.stop (/Users/xxxxxxxx/Documents/Pact Workspace/pact_node_demo/jsConsumer/node_modules/@pact-foundation/pact-node/src/server.js:178:12)
at Server. (/Users/xxxxxxxx/Documents/Pact Workspace/pact_node_demo/jsConsumer/node_modules/@pact-foundation/pact-node/src/server.js:136:8)
at ChildProcess.g (events.js:260:16)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827:16)
at Socket. (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:486:12)
node.js:777
throw errnoException(err, 'kill');
^

Error: kill ESRCH
at exports.errnoException (util.js:873:11)
at process.kill (node.js:777:15)
at Server.stop (/Users/xxxxxxxx/Documents/Pact Workspace/pact_node_demo/jsConsumer/node_modules/@pact-foundation/pact-node/src/server.js:178:12)
at Server.delete (/Users/xxxxxxxx/Documents/Pact Workspace/pact_node_demo/jsConsumer/node_modules/@pact-foundation/pact-node/src/server.js:189:14)
at /Users/xxxxxxxx/Documents/Pact Workspace/pact_node_demo/jsConsumer/node_modules/@pact-foundation/pact-node/src/pact.js:55:23
at Function.
.map._.collect (/Users/xxxxxxxx/Documents/Pact Workspace/pact_node_demo/jsConsumer/node_modules/@pact-foundation/pact-node/node_modules/underscore/underscore.js:172:24)
at Object.removeAllServers (/Users/xxxxxxxx/Documents/Pact Workspace/pact_node_demo/jsConsumer/node_modules/@pact-foundation/pact-node/src/pact.js:54:17)
at shutdownPactServer (/Users/xxxxxxxx/Documents/Pact Workspace/pact_node_demo/jsConsumer/gulpfile.js:19:14)
at removeAllListeners (/Users/xxxxxxxx/Documents/Pact Workspace/pact_node_demo/jsConsumer/node_modules/karma/lib/server.js:379:7)
at /Users/xxxxxxxx/Documents/Pact Workspace/pact_node_demo/jsConsumer/node_modules/karma/lib/server.js:390:9
at Server. (net.js:1491:9)
at Server.g (events.js:260:16)
at emitNone (events.js:72:20)
at Server.emit (events.js:166:7)
at emitCloseNT (net.js:1537:8)
at nextTickCallbackWith1Arg (node.js:431:9)

Dont think the node modules installed correctly! You running on windows!?

Mac El Capitan 10.11.6

This is how it looks at the moment...Please see the attached screenshot of eclipse IDE

image

what version of node and npm you have?

my versions are:
v0.12.5
2.14.7

I would try to clean the modules npm cache clean and install again.

Node - 4.4.7
npm - 2.15.8
don't have nvm installed. I'll try with that.

So, I cloned this project again and the jsConsumer created the pact successfully.

This time I updated to the latest versions of node and npm. (You can use nvm to do this)

Versions are:
node --version && npm --version
v6.3.1
3.10.3

Steps were:
run npm install
npm install -g gulp
gulp createPacts

Thanks Very Much Shane !
my node and npm were messed up. Removed both and reinstalled both.
Now everything works.

Really appreciate your help. Huge Thankyou !!!

Not a problem mate. You test the publishing with my docker containers?

yes, with docker-pact-postgres

On 17 August 2016 at 09:11, shane lee notifications@github.com wrote:

Not a problem mate. You test the publishing with my docker containers?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATcudfssDMdE3JtPvVQH2rCD6JWyBaLIks5qgkOZgaJpZM4JlCIN
.

************** PLEASE CONSIDER OUR ENVIRONMENT BEFORE PRINTING *************

******************* Confidentiality and Privilege Notice


This e-mail is intended only to be read or used by the addressee. It is
confidential and may contain legally privileged information. If you are not
the addressee indicated in this message (or responsible for delivery of the
message to such person), you may not copy or deliver this message to
anyone, and you should destroy this message and kindly notify the sender by
reply e-mail. Confidentiality and legal privilege are not waived or lost by
reason of mistaken delivery to you.

Qantas Airways Limited ABN 16 009 661 901

Visit Qantas online at http://qantas.com