-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Use supertest instead of repo-tools test app #1416
Conversation
@bcoe Can you review this? |
8852e17
to
fe2ed3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love it 😄 a couple small notes:
- it's really easy to add test coverage, which might be worth drawing people's attention to (I use this as part of my toolbox).
- I think we can drop the repo tools dependency.
@@ -15,15 +15,17 @@ | |||
"scripts": { | |||
"deploy": "gcloud app deploy", | |||
"start": "node app.js", | |||
"system-test": "repo-tools test app", | |||
"system-test": "mocha --exit test/*.test.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to keep dependencies as light as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But lol, that coverage looks good!
"test": "npm run system-test", | ||
"e2e-test": "repo-tools test deploy" | ||
}, | ||
"dependencies": { | ||
"express": "^4.16.3" | ||
}, | ||
"devDependencies": { | ||
"@google-cloud/nodejs-repo-tools": "^3.3.0" | ||
"@google-cloud/nodejs-repo-tools": "^3.3.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can delete this dependency now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No :) It's used in the e2e-test. But turns out, we're not calling 2e2-test from CI, instead we have special test files that run a deployment. But I'll prefer deleting it in a separate PR. There's a lot of magic happening in repo-tools
based on env variables.
@@ -15,15 +15,17 @@ | |||
"scripts": { | |||
"deploy": "gcloud app deploy", | |||
"start": "node app.js", | |||
"system-test": "repo-tools test app", | |||
"system-test": "mocha --exit test/*.test.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --exit
always makes me nervous, but it's not really blocking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests don't finish without --exit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default for --exit
was changed relatively recently in mocha:
I think it's reasonable to go back to the old default ... alternatively you'd need to capture the server
object returned by app.listen
and then call .close()
on it when tests are complete... sounds like a hassle 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So by using --exit
I'm just using Mocha the way it used to be, right?
Trying to remove
repo-tools
. Will send a follow up PR that removesrepo-tools test deploy
.Ref: #1247