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

Support running via npx #22

Closed
lidel opened this issue Apr 20, 2022 · 3 comments · Fixed by #28 or #54
Closed

Support running via npx #22

lidel opened this issue Apr 20, 2022 · 3 comments · Fixed by #28 or #54

Comments

@lidel
Copy link
Member

lidel commented Apr 20, 2022

  • publish to NPM (manually)
  • allow people to run the latest version via npx @ipfs-shipyard/pinning-service-compliance
  • update example in readme to use npx instead of elaborate local build
@SgtPooki SgtPooki self-assigned this Apr 20, 2022
@SgtPooki SgtPooki added this to the Initial release milestone Apr 21, 2022
@SgtPooki
Copy link
Member

Currently experiencing a bug where some errors arent' being handled properly when running from npx (not experienced when running from package directly, or running from npx in same directory as package):

npx -p @ipfs-shipyard/pinning-service-compliance@0.0.2 -- pinning-service-compliance -d -s $ESTUARY_API_ENDPOINT $ESTUARY_API_TOKEN
2022-04-21T23:35:51.688Z [debug] : Starting compliance check 'checkEmptyBearerToken'
Request with no authentication token
	✓ Response object matches api spec schema
	✘ Returns a 403
2022-04-21T23:35:51.849Z [debug] : Wrote markdown to /Users/sgtpooki/.npm/_npx/43361ddce2ed0465/node_modules/@ipfs-shipyard/pinning-service-compliance/docs/api.estuary.tech.md
2022-04-21T23:35:51.861Z [debug] : Starting compliance check 'checkInvalidBearerToken'
Request with invalid token
	✓ Response object matches api spec schema
	✘ Returns a 403
2022-04-21T23:35:52.808Z [debug] : Wrote markdown to /Users/sgtpooki/.npm/_npx/43361ddce2ed0465/node_modules/@ipfs-shipyard/pinning-service-compliance/docs/api.estuary.tech.md
2022-04-21T23:35:52.810Z [debug] : Starting compliance check 'addPin'
2022-04-21T23:35:52.829Z [error] : Problem running compliance check: 'addPin': SyntaxError: Unexpected end of JSON input
2022-04-21T23:35:52.829Z [debug] : Starting compliance check 'deleteNewPin'
2022-04-21T23:35:52.841Z [error] : Problem running compliance check: 'deleteNewPin': SyntaxError: Unexpected end of JSON input
2022-04-21T23:35:52.841Z [debug] : Starting compliance check 'getAllPins'
List pin objects (GET /pins) in all states
	✘ Response object matches api spec schema
	✓ Response is successful
	✓ Response statusCode is 200
2022-04-21T23:36:36.286Z [debug] : Wrote markdown to /Users/sgtpooki/.npm/_npx/43361ddce2ed0465/node_modules/@ipfs-shipyard/pinning-service-compliance/docs/api.estuary.tech.md
2022-04-21T23:36:36.288Z [debug] : Starting compliance check 'replacePin'
2022-04-21T23:36:36.304Z [error] : Problem running compliance check: 'replacePin': SyntaxError: Unexpected end of JSON input
2022-04-21T23:36:36.304Z [debug] : Starting compliance check 'matchPin'
2022-04-21T23:36:36.318Z [error] : Problem running compliance check: 'matchPin': SyntaxError: Unexpected end of JSON input
2022-04-21T23:36:36.318Z [debug] : Starting compliance check 'testPagination'
Get all pins
	✓ Response is ok
	✓ Result is not null
2022-04-21T23:37:18.428Z [debug] : Wrote markdown to /Users/sgtpooki/.npm/_npx/43361ddce2ed0465/node_modules/@ipfs-shipyard/pinning-service-compliance/docs/api.estuary.tech.md
2022-04-21T23:37:18.448Z [error] : Problem running compliance check: 'testPagination': SyntaxError: Unexpected end of JSON input
2022-04-21T23:37:18.448Z [debug] : Starting compliance check 'deleteAllPins'
Can delete all pins
	✘ Can delete pin with requestid '28174232'
	✓ Final pinsGet call returns a count of zero
2022-04-21T23:38:43.878Z [debug] : Wrote markdown to /Users/sgtpooki/.npm/_npx/43361ddce2ed0465/node_modules/@ipfs-shipyard/pinning-service-compliance/docs/api.estuary.tech.md

https://api.estuary.tech/pinning compliance:

Summary (1/5 successful)

  ✘ Request with no authentication token
  ✘ Request with invalid token
  ✘ List pin objects (GET /pins) in all states
  ✓ Get all pins
  ✘ Can delete all pins


See the full report at /Users/sgtpooki/.npm/_npx/43361ddce2ed0465/node_modules/@ipfs-shipyard/pinning-service-compliance/docs/api.estuary.tech.md

@SgtPooki
Copy link
Member

testing with an npm pack file now:

npx ipfs-shipyard-pinning-service-compliance-0.0.3.tgz -s $PINATA_API_ENDPOINT $PINATA_API_TOKEN -d |& grep -A 3 'The total counts'
npx ipfs-shipyard-pinning-service-compliance-0.0.3.tgz -s $WEB3_API_ENDPOINT $WEB3_API_TOKEN -d |& grep -A 3 'The total counts'
npx ipfs-shipyard-pinning-service-compliance-0.0.3.tgz -s $ESTUARY_API_ENDPOINT $ESTUARY_API_TOKEN -d |& grep -A 3 'The total counts'
npx ipfs-shipyard-pinning-service-compliance-0.0.3.tgz -s $NFT_API_ENDPOINT $NFT_API_TOKEN -d |& grep -A 3 'The total counts'

@SgtPooki
Copy link
Member

npx ipfs-shipyard-pinning-service-compliance-0.0.3.tgz -s $PINATA_API_ENDPOINT $PINATA_API_TOKEN -d |& grep -A 3 'The total counts'
npx ipfs-shipyard-pinning-service-compliance-0.0.3.tgz -s $WEB3_API_ENDPOINT $WEB3_API_TOKEN -d |& grep -A 3 'The total counts'
npx ipfs-shipyard-pinning-service-compliance-0.0.3.tgz -s $ESTUARY_API_ENDPOINT $ESTUARY_API_TOKEN -d |& grep -A 3 'The total counts'
npx ipfs-shipyard-pinning-service-compliance-0.0.3.tgz -s $NFT_API_ENDPOINT $NFT_API_TOKEN -d |& grep -A 3 'The total counts'
2022-05-24T18:04:06.654Z [debug] : The total counts for this run are:
    Total Expectations          81
    Total ApiCall instances     47
    Total FirstClass ApiCalls   13
2022-05-24T18:05:18.125Z [debug] : The total counts for this run are:
    Total Expectations          81
    Total ApiCall instances     48
    Total FirstClass ApiCalls   13
2022-05-24T18:06:09.570Z [debug] : The total counts for this run are:
    Total Expectations          79
    Total ApiCall instances     46
    Total FirstClass ApiCalls   13
2022-05-24T18:07:11.174Z [debug] : The total counts for this run are:
    Total Expectations          62
    Total ApiCall instances     35
    Total FirstClass ApiCalls   13

fixed by #52

@SgtPooki SgtPooki linked a pull request May 24, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment