-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Service tests #937
Service tests #937
Conversation
@niccokunzmann Since you like working on documentation, could I ask you take a look at this? What would be really awesome is, if you could pick a service, follow the tutorial, and see how you make out! |
I think,
I want to create more PRs |
vendor/README.md
Outdated
In this tutorial, we'll write tests for the Travis badge: | ||
|
||
```js | ||
camp.route(/^\/travis(-ci)?\/([^\/]+\/[^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/, |
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.
In this example, I would like to discuss what needs testing and what not.
This can be done with the // (1)
annotations.
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.
Addressed in 1002045.
vendor/README.md
Outdated
.get('/rust-lang/rust.json') | ||
.expectJSONTypes(Joi.object().keys({ | ||
name: Joi.equal('build'), | ||
value: Joi.equal('failing', 'passing', 'unknown') |
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.
What does this mean?
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.
Addressed in 555251d.
If you merge this without the travis test being implemented, the commit can be checked out and the tutorial can be continued from this. https://docs.djangoproject.com/en/dev/intro/contributing/#rolling-back-to-a-previous-revision-of-django |
vendor/README.md
Outdated
|
||
```js | ||
t.create('build status on default branch') | ||
.get('/rust-lang/rust.json') |
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.
Why do we need rust?
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 understand! https://github.com/badges/shields/pull/937/files#diff-2bcb895f83ee1e2e5fc386962bf9d6c0R157
This is the url we want to test.
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.
Addressed in 5e9ec62.
vendor/README.md
Outdated
|
||
When defining an IcedFrisby test, typically you would invoke the `toss()` | ||
method, to register the test. However, this is not necessary when using | ||
ServiceTester. |
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.
Why? Is it implemented?
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.
Addressed in 8b14abe.
vendor/README.md
Outdated
Run the test: | ||
|
||
``` | ||
npm run test:vendor -- --only=travis |
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.
This is a small "travis" above, we used thebig travis. Is this referring to /travis
or the name?
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.
Added this as a todo above.
vendor/README.md
Outdated
``` | ||
|
||
|
||
Getting help |
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.
This could be at the beginning. If I needed help during the tutorial, I would not have reached this.
@niccokunzmann Just wanted to let you know I would be sitting down to incorporate your comments. Thank you. They were all super helpful! And, glad you want to create more PRs! |
The PRs are here: paulmelnikow/shields#1 paulmelnikow/shields#2 paulmelnikow/shields#3 |
Nice work! I added you as a collaborator on my fork. Feel free to push more commits to this branch if you'd like. |
Should we change the vendor-badge issue tag to service? |
# Conflicts: # doc/TUTORIAL.md
Merged this! Thanks @niccokunzmann and @Daniel15. |
Add file size test
Add file size test
Add file size test
Also, include `lib/suggest.js` which is part of the server, and rename `vendor` to `service-tests` to match the renames which occurred during the review of #937.
Goals
For further background, I wrote a lot about my thinking in #927.
Features
Solution
npm run test:vendor
. It's invoked during scheduled nightly builds in Travis, which means the results are public and easily accessed. Any failure will be reported as such, which seems helpful since it will bring it to our attention. However we could silence them if we find the failures are too noisy. Pushes to master run lint and the existing unit tests. Only the nightly build adds the vendor tests.npm run test:vendor -- --only=travis
Suggested review order
Todos