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

Fixes #165 - npm run remotetest completes cleanly #166

Merged
merged 15 commits into from
Oct 16, 2019

Conversation

kurtkanaskie
Copy link
Contributor

While fixing remotetest.js, identified and fixed additional issues #158 #160 #161 and #163

Unfortunately, there are a lot of formatting changes to remotetest.js

@kurtkanaskie
Copy link
Contributor Author

kurtkanaskie commented Sep 23, 2019

The gist of these fixes are:

  • remotetest.js was modified to flatten the describe / it tests which makes it much easier to understand the tests and their flows. This caused lots of edits, sorry.
  • remotetest.js was enhanced to remove any test artifacts (e.g. proxies) and now leaves the org as it was before testing.
  • options.js and defaults.js where modified to identify "default" options so the "command specific" options can be highlighted in help
  • Error handling and tests were improved to detect missing options.
  • The following issues where also fixed in this merge: 158, 160, 161, 163.
  • Due to the previous pull request, jasmine is now used to test options, via "npm test".
  • To test features use: "npm rurn remotetest"

@kurtkanaskie
Copy link
Contributor Author

Test for Issue #159
$ mocha -R spec remotetests --grep "SharedFlows and FlowHooks"
SharedFlows and FlowHooks
✓ Deploy SharedFlow (3691ms)
✓ listSharedFlowDeployments (442ms)
✓ fetchSharedFlow (194ms)
✓ getPreviousSharedFlow (144ms)
✓ attachFlowHook (493ms)
✓ detachFlowHook (238ms)
✓ re-attachFlowHook (584ms)
✓ undeploySharedFlow (1513ms)
✓ deleteSharedFlow (702ms)
9 passing (8s)

@kurtkanaskie
Copy link
Contributor Author

Test for Issue #162
$ mocha -R spec remotetests --grep "Target Servers"
Target Servers
✓ Create Target Server (512ms)
✓ List Target Servers (173ms)
✓ Get Target Server (165ms)
✓ Delete Target Server (372ms)
4 passing (1s)

@kurtkanaskie
Copy link
Contributor Author

Test for Issue #167
$ mocha -R spec remotetests --grep "User Roles and Permissions"
User Roles and Permissions
✓ Create Role (329ms)
✓ Get Role (228ms)
✓ List Roles (252ms)
✓ Set Role Permissions (183ms)
✓ Get Role Permissions (175ms)
✓ Assign User to Role (247ms)
✓ Verify User in Role (191ms)
✓ List Users in a Role (253ms)
✓ Verify access allowed (156ms)
✓ Remove User from Role (166ms)
✓ Delete Role (183ms)
11 passing (2s)

@kurtkanaskie
Copy link
Contributor Author

kurtkanaskie commented Sep 24, 2019

All done!
$ npm test

[email protected] test /Users/kurtkanaskie/work/apigee/apigeetool-prs/apigeetool-node-PRS
jasmine test/testoptions.js
Started
..............
14 specs, 0 failures
Finished in 0.029 seconds

$ npm run remotetest (NOTE: hosted target fails due to current omg/16078)

[email protected] remotetest /Users/kurtkanaskie/work/apigee/apigeetool-prs/apigeetool-node-PRS
mocha -R spec remotetests

Remote Tests
✓ Deploy Apigee Proxy (16192ms)
✓ Create Product (334ms)
✓ Create Private Product (767ms)
✓ Create Developer (262ms)
✓ Create App (488ms)
✓ Delete App (757ms)
✓ Delete Developer (592ms)
✓ Delete API Product (404ms)
✓ Delete API private Product (399ms)
✓ Deploy Apigee Proxy (84312ms)
✓ Verify deployed URI (124ms)
✓ List Deployments by app (867ms)
✓ List Deployments by environment (5437ms)
✓ Undeploy Apigee Proxy With Revision (1065ms)
✓ Deploy Apigee Proxy with base path (19911ms)
✓ Verify deployed URI (103ms)
✓ Deploy Apigee Proxy with base path and run NPM remotely (85704ms)
✓ Verify deployed URI (116ms)
✓ Undeploy Apigee Proxy With Revision (801ms)
✓ Fetch proxy (606ms)
✓ Delete proxy (778ms)

Node.js Apps
✓ Deploy Node.js App (13812ms)
✓ Verify deployed URI (112ms)
✓ Check logs from deployed URI (219ms)
✓ Deploy Node.js App and run NPM remotely (93155ms)
✓ Verify deployed URI (116ms)
✓ List Deployments by app (1185ms)
✓ Undeploy Node.js App Without Revision (1377ms)
✓ Delete node proxy (408ms)

Hosted Target
✓ Deploy Hosted Targets App (94568ms)
✓ List Deployments by app (1108ms)
✓ Verify deployed URI (162ms)
✓ Check build logs from deployed URI (1371ms)
✓ Check runtime logs from deployed URI (1931ms)
✓ Undeploy Hosted Targets App Without Revision (5828ms)
✓ Delete hosted target proxy (3167ms)

Caches
✓ Create an Cache Resource (343ms)
✓ Delete Cache Resource (345ms)

Target Servers
✓ Create Target Server (390ms)
✓ List Target Servers (167ms)
✓ Get Target Server (188ms)
✓ Delete Target Server (270ms)

KVM
✓ Create KVM (543ms)
✓ Create Encrypted KVM (818ms)
✓ Delete Encrypted KVM (341ms)
✓ Add Entry to KVM (682ms)
✓ Get KVM Entry (310ms)
✓ Get KVM Map (591ms)
✓ Delete KVM Entry (532ms)
✓ Delete KVM (408ms)

SharedFlows and FlowHooks
✓ Deploy SharedFlow (2598ms)
✓ listSharedFlowDeployments (432ms)
✓ fetchSharedFlow (242ms)
✓ getPreviousSharedFlow (151ms)
✓ attachFlowHook (652ms)
✓ detachFlowHook (258ms)
✓ re-attachFlowHook (334ms)
✓ undeploySharedFlow (1269ms)
✓ deleteSharedFlow (286ms)

User Roles and Permissions
✓ Create Role (176ms)
✓ Get Role (168ms)
✓ List Roles (140ms)
✓ Set Role Permissions (209ms)
✓ Get Role Permissions (178ms)
✓ Assign User to Role (198ms)
✓ Verify User in Role (137ms)
✓ List Users in a Role (164ms)
✓ Verify access allowed (383ms)
✓ Remove User from Role (141ms)
✓ Delete Role (202ms)

70 passing (8m)

Copy link
Member

@whitlockjc whitlockjc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor question about removing the --json flag.

README.md Outdated
@@ -76,9 +82,6 @@ trusted TLS certificate.
(optional) Limit for the maximum number of operations performed concurrently.
Currently this only affects file uploads in the `deploynodeapp` command. Defaults to 4.

`--json -j`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not, my bad, I wasn't sure what it was for, but now I do.
I'll add it back.

@whitlockjc whitlockjc merged commit e6a14c2 into apigee:master Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants