-
-
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
[GithubGistLastCommit] GitHub gist last commit #8272
[GithubGistLastCommit] GitHub gist last commit #8272
Conversation
…gist-last-commit being in svg format, rather than json
|
The github-gist-last-commit service development is done- but I have issues with tests. If I add This is the error that I am currently getting while running the test suite: |
@PaulaBarszcz - the one uncommented test you have works fine with when the |
Thanks, the fixed tests are pushed. Now I'm trying to figure out where can I check the available names for the test suites to put in the PR's title. I updated the PR's description. |
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.
Thank you! This is looking pretty good, few minor things left inline for your review
t.create('last commit in gist (recent)') | ||
.get('/7e188c35fd5ca754c970e3a1caf045ef.json') | ||
.intercept(nock => | ||
nock('https://api.github.com') | ||
.get('/gists/7e188c35fd5ca754c970e3a1caf045ef') | ||
.reply(200, { | ||
updated_at: dayjs(), | ||
}) | ||
) | ||
.expectBadge({ label: 'last commit', message: 'today', color: 'brightgreen' }) | ||
|
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 hate to mention this since I'm sure you had fun battling nock 😄 but I think we should drop this test.
We mostly use our service tests as an integration and e2e style test suite to both give us some high level assurances about the service and routes, but particularly the touch points with the hundreds of backend APIs we integrate with (and which can change without notice).
In cases where we have service class with non trivial render
or transform
functions we will add more standard unit tests to validate those, but we typically refrain from doing so when those are simple functions or just using some of our standard helpers like this one is (those helpers are extensively tested elsewhere).
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 hate to mention this since I'm sure you had fun battling nock 😄 but I think we should drop this test.
Haha, a little bit :D
Sure, removed this test :)
Implementation of the changes is done, and this PR is ready for a re-review :) |
You typically only want to run the tests relevant for the code being added or modified. The more generic/higher level the filter the more tests get executed, and the greater the potential for failures/brittleness in tests that weren't actually related to proposed changes. In this case we'd actually want to use I've updated the title and re-executed the tests accordingly |
No, these are fine as-is 👍 |
Cool, thanks.
Great, thank you. Should anything else be changed/added in this PR? :) |
Nope all set. I was just waiting for feedback from others offline relative to the route pattern for github gist badges going forward but we're good to go! |
Related issue: #7884
Locally looks like this (updated with the new path,
{ base: 'github-gist/last-commit', pattern: ':gistId' }
):Print screens of example gists generated today (3rd of August 2022):
https://api.github.com/gists/8710649
gistId: 8710649
"updated_at": "2022-08-03T02:58:04Z",
https://api.github.com/gists/870071abadfd66a28bf539677332f12b
gistId: 870071abadfd66a28bf539677332f12b
"updated_at": "2020-10-01T13:50:24Z",
https://api.github.com/gists/7e188c35fd5ca754c970e3a1caf045ef
gistId: 7e188c35fd5ca754c970e3a1caf045ef
"updated_at": "2020-07-27T17:28:45Z",
https://api.github.com/gists/871064
gistId: 871064
"updated_at": "2015-09-25T05:28:06Z",
https://api.github.com/gists/55555555555555
gistId: 55555555555555
"message": "Not Found",
I confirmed locally that it still works after the changes following the review: