You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 5, 2024. It is now read-only.
$ yarn build --scope=automatic-releases && clear && GITHUB_ACTIONS=true yarn test automatic-releases --testNamePattern=smoke --verboseyarn run v1.22.17
$ yarn jest --env=node --colors automatic-releases --testNamePattern=smoke --verbose
$ /home/ubuntu/actions/node_modules/.bin/jest --env=node --colors automatic-releases --testNamePattern=smoke --verbose... FAIL automatic-releases packages/automatic-releases/__tests__/automaticReleases-smoke.test.ts automatic releases smoke tests ✕ should create a new release tag (789 ms) ✕ should update an existing release tag (511 ms) ● automatic releases smoke tests › should create a new release tag Command failed: /tmp/yarn--1643715452751-0.7636044769559776/node /tmp/ghactions-pWazxx/index.js (node:13079) UnhandledPromiseRejectionWarning: HttpError: request to https://releaseupload.example.com/ failed, reason: getaddrinfo ENOTFOUND releaseupload.example.com releaseupload.example.com:443 ...stacktrace ● automatic releases smoke tests › should update an existing release tag Command failed: /tmp/yarn--1643715452751-0.7636044769559776/node /tmp/ghactions-TNi1qv/index.js (node:13093) UnhandledPromiseRejectionWarning: HttpError: request to https://releaseupload.example.com/ failed, reason: getaddrinfo ENOTFOUND releaseupload.example.com releaseupload.example.com:443 ...stacktrace FAIL automatic-releases packages/automatic-releases/__tests__/taggedReleases-smoke.test.ts tagged releases smoke tests ✕ should create a new release (509 ms) ● tagged releases smoke tests › should create a new release Command failed: /tmp/yarn--1643715452751-0.7636044769559776/node /tmp/ghactions-ZweEYz/index.js (node:13109) UnhandledPromiseRejectionWarning: HttpError: request to https://releaseupload.example.com/ failed, reason: getaddrinfo ENOTFOUND releaseupload.example.com releaseupload.example.com:443 ...stacktrace...Test Suites: 2 failed, 4 skipped, 2 of 6 totalTests: 3 failed, 13 skipped, 16 totalSnapshots: 0 totalTime: 6.318 s, estimated 8 sRan all test suites matching /automatic-releases/i with tests matching "smoke".Jest did not exit one second after the test run has completed.This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
As you can see, something does not work. After some tests, I think I've found the reason:
Those smoke tests have passed in the past few years because uploadReleaseArtifacts()didn't fail if a file glob doesn't match anything. If there is a mismatch glob, uploadReleaseArtifacts() will silently return. Thus, most of the code in "uploadReleaseArtifacts.ts" has not been tested. Those are not qualified smoke tests, I think.
So,
Handling the request is the responsibility of our mock website (i.e., the "Express.js" server). To fix this, we need to make the upload_url field contain a reachable URL.
Firstly, let's make the following changes based on 9ecff5f :
git diff
Please note that we do have two files ("LICENSE" and "test.jar") that match the above two globs.
Then, build "automatic-releases" and test it:
(to avoid huge and useless error report, you may need to change
optimization.minimize
tofalse
in "packages/automatic-releases/webpack.config.js" temporarily)As you can see, something does not work. After some tests, I think I've found the reason:
https://releaseupload.example.com
) in mockNewReleaseTag.ts, mockNewTaggedRelease.ts and mockUpdateExistingTag.ts is fetched by "createRelease()
" and used as the target ofuploadReleaseAsset()
inuploadReleaseArtifacts()
.uploadReleaseAsset()
wants to send a POST request to that website, but apparently, no one could handle the request.uploadReleaseArtifacts()
didn't fail if a file glob doesn't match anything. If there is a mismatch glob,uploadReleaseArtifacts()
will silently return. Thus, most of the code in "uploadReleaseArtifacts.ts" has not been tested. Those are not qualified smoke tests, I think.So,
upload_url
field contain a reachable URL.core.error
is just a logging function and it won't throw anything, so the error handling code at main.ts#L321-L323 would not work in this case. We need to change the behavior ofuploadReleaseArtifacts()
.The text was updated successfully, but these errors were encountered: