Skip to content

Commit

Permalink
✨ fix tests for release
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaillon committed Nov 21, 2024
1 parent 4ead842 commit c348805
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
28 changes: 14 additions & 14 deletions tests.d/1002-lib-kurl/results.approved.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ http return code was ⌈200⌉
Content of downloaded file:
⌈Writing stuff to file because the --output option was given.⌉
stderr:
⌈▶ called curl --silent --show-error --location --write-out %{http_code} --output /tmp/valet.d/kurl-test --code 200 -curlOption1 --fakeOpt2 https://hello.com
⌈▶ called curl --silent --show-error --location --write-out %{response_code} --output /tmp/valet.d/kurl-test --code 200 -curlOption1 --fakeOpt2 https://hello.com
```

Expand All @@ -32,7 +32,7 @@ http return code was ⌈500⌉
Content of downloaded file:
⌈Writing stuff to file because the --output option was given.⌉
stderr:
⌈▶ called curl --silent --show-error --location --write-out %{http_code} --output /tmp/valet.d/kurl-test --code 500 https://hello.com
⌈▶ called curl --silent --show-error --location --write-out %{response_code} --output /tmp/valet.d/kurl-test --code 500 https://hello.com
```

Expand All @@ -50,7 +50,7 @@ Exit code: `1`

```log
TRACE Curl error output stream:
1 ░ ▶ called curl --silent --show-error --location --write-out %{http_code} --output /tmp/valet.d/kurl-test --code 500 https://hello.com
1 ░ ▶ called curl --silent --show-error --location --write-out %{response_code} --output /tmp/valet.d/kurl-test --code 500 https://hello.com
2 ░
ERROR The http return code ⌜500⌝ is not acceptable for url ⌜https://hello.com⌝.
```
Expand All @@ -68,7 +68,7 @@ http return code was ⌈500⌉
Content of downloaded file:
⌈Writing stuff to file because the --output option was given.⌉
stderr:
⌈▶ called curl --silent --show-error --location --write-out %{http_code} --output /tmp/valet.d/kurl-test --code 500 https://hello.com
⌈▶ called curl --silent --show-error --location --write-out %{response_code} --output /tmp/valet.d/kurl-test --code 500 https://hello.com
```

Expand All @@ -85,7 +85,7 @@ http return code was ⌈400⌉
Content of downloaded file:
⌈Writing stuff to file because the --output option was given.⌉
stderr:
⌈▶ called curl --silent --show-error --location --write-out %{http_code} --output /tmp/valet.d/kurl-test --code 400 --error https://hello.com/bla --otherOpt
⌈▶ called curl --silent --show-error --location --write-out %{response_code} --output /tmp/valet.d/kurl-test --code 400 --error https://hello.com/bla --otherOpt
Returning 1 from curl.
```
Expand All @@ -96,11 +96,11 @@ Returning 1 from curl.
DEBUG Log level set to debug.
WARNING Beware that debug log level might lead to secret leak, use it only if necessary.
DEBUG Executing the command ⌜curl⌝ with arguments (quoted):
'--silent' '--show-error' '--location' '--write-out' '%{http_code}' '--output' '/tmp/valet.d/kurl-test' '--code' '400' '--error' 'https://hello.com/bla' '--otherOpt'
'--silent' '--show-error' '--location' '--write-out' '%{response_code}' '--output' '/tmp/valet.d/kurl-test' '--code' '400' '--error' 'https://hello.com/bla' '--otherOpt'
DEBUG The command ⌜curl⌝ originally ended with exit code ⌜1⌝.
DEBUG The curl command for url ⌜https://hello.com/bla⌝ ended with exit code ⌜1⌝, the http return code was ⌜400⌝.
TRACE Curl error output stream:
1 ░ ▶ called curl --silent --show-error --location --write-out %{http_code} --output /tmp/valet.d/kurl-test --code 400 --error https://hello.com/bla --otherOpt
1 ░ ▶ called curl --silent --show-error --location --write-out %{response_code} --output /tmp/valet.d/kurl-test --code 400 --error https://hello.com/bla --otherOpt
2 ░ Returning 1 from curl.
3 ░
DEBUG The http return code ⌜400⌝ is not acceptable for url ⌜https://hello.com/bla⌝.
Expand All @@ -119,7 +119,7 @@ http return code was ⌈200⌉
Content of downloaded file:
⌈Writing stuff to file because the --output option was given.⌉
stderr:
⌈▶ called curl --silent --show-error --location --write-out %{http_code} --output /tmp/valet.d/kurl-test --code 200 http://hello.com
⌈▶ called curl --silent --show-error --location --write-out %{response_code} --output /tmp/valet.d/kurl-test --code 200 http://hello.com
```

Expand All @@ -129,7 +129,7 @@ stderr:
DEBUG Log level set to debug.
WARNING Beware that debug log level might lead to secret leak, use it only if necessary.
DEBUG Executing the command ⌜curl⌝ with arguments (quoted):
'--silent' '--show-error' '--location' '--write-out' '%{http_code}' '--output' '/tmp/valet.d/kurl-test' '--code' '200' 'http://hello.com'
'--silent' '--show-error' '--location' '--write-out' '%{response_code}' '--output' '/tmp/valet.d/kurl-test' '--code' '200' 'http://hello.com'
DEBUG The command ⌜curl⌝ originally ended with exit code ⌜0⌝.
The error code ⌜0⌝ is acceptable and has been reset to 0.
DEBUG The curl command for url ⌜http://hello.com⌝ ended with exit code ⌜0⌝, the http return code was ⌜200⌝.
Expand All @@ -149,7 +149,7 @@ http return code was ⌈200⌉
stdout:
⌈⌉
stderr:
⌈▶ called curl --silent --show-error --location --write-out %{http_code} --output /tmp/valet-work --code 200 http://hello.com
⌈▶ called curl --silent --show-error --location --write-out %{response_code} --output /tmp/valet-work --code 200 http://hello.com
```

Expand All @@ -167,7 +167,7 @@ Exit code: `1`

```log
TRACE Curl error output stream:
1 ░ ▶ called curl --silent --show-error --location --write-out %{http_code} --output /tmp/valet-work --code 500 http://hello.com
1 ░ ▶ called curl --silent --show-error --location --write-out %{response_code} --output /tmp/valet-work --code 500 http://hello.com
2 ░
ERROR The http return code ⌜500⌝ is not acceptable for url ⌜http://hello.com⌝.
```
Expand All @@ -185,7 +185,7 @@ http return code was ⌈400⌉
stdout:
⌈Writing stuff to file because the --output option was given.⌉
stderr:
⌈▶ called curl --silent --show-error --location --write-out %{http_code} --output /tmp/valet-work --code 400 http://hello.com
⌈▶ called curl --silent --show-error --location --write-out %{response_code} --output /tmp/valet-work --code 400 http://hello.com
```

Expand All @@ -195,12 +195,12 @@ stderr:
DEBUG Log level set to debug.
WARNING Beware that debug log level might lead to secret leak, use it only if necessary.
DEBUG Executing the command ⌜curl⌝ with arguments (quoted):
'--silent' '--show-error' '--location' '--write-out' '%{http_code}' '--output' '/tmp/valet-work' '--code' '400' 'http://hello.com'
'--silent' '--show-error' '--location' '--write-out' '%{response_code}' '--output' '/tmp/valet-work' '--code' '400' 'http://hello.com'
DEBUG The command ⌜curl⌝ originally ended with exit code ⌜0⌝.
The error code ⌜0⌝ is acceptable and has been reset to 0.
DEBUG The curl command for url ⌜http://hello.com⌝ ended with exit code ⌜0⌝, the http return code was ⌜400⌝.
TRACE Curl error output stream:
1 ░ ▶ called curl --silent --show-error --location --write-out %{http_code} --output /tmp/valet-work --code 400 http://hello.com
1 ░ ▶ called curl --silent --show-error --location --write-out %{response_code} --output /tmp/valet-work --code 400 http://hello.com
2 ░
DEBUG The http return code ⌜400⌝ is not acceptable for url ⌜http://hello.com⌝.
```
Expand Down
7 changes: 1 addition & 6 deletions tests.d/1103-self-release/01.self-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@ function interactive::promptYesNo() {

function kurl::toVar() {
echo "▶ called kurl::toVar $*" 1>&2
if [[ $* == *"tag_name"* ]]; then
# post on the release endpoint
RETURNED_VALUE='{ "upload_url": "https://uploads.github.com/repos/jcaillon/valet/releases/xxxx/assets{?name,label}" }'
else
RETURNED_VALUE=""
fi
RETURNED_VALUE='{ "upload_url": "https://uploads.github.com/repos/jcaillon/valet/releases/xxxx/assets{?name,label}", "tag_name": "v1.2.3" }'
RETURNED_VALUE2=""
RETURNED_VALUE3=200
}
Expand Down
21 changes: 13 additions & 8 deletions tests.d/1103-self-release/results.approved.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ Exit code: `0`
```log
INFO Dry run mode is enabled, no changes will be made.
▶ called io::invoke git rev-parse HEAD
INFO The current version of valet is: 1.2.3.
INFO Found 113 functions with documentation.
▶ called io::invoke git tag --sort=version:refname --no-color
INFO The last tag is: v1.2.3.
▶ called kurl::toVar true 200 -H Accept: application/vnd.github.v3+json https://api.github.com/repos/jcaillon/valet/releases/latest
INFO The current version of valet is: 1.2.3.
INFO Found 113 functions with documentation.
▶ called io::invoke git log --pretty=format:%s v1.2.3..HEAD
INFO The tag message is:
1 ░ # Release of version 1.2.3
Expand Down Expand Up @@ -60,6 +61,9 @@ githubReleaseToken="token"
bumpLevel="minor"
▶ called io::invoke git rev-parse HEAD
▶ called io::invoke git tag --sort=version:refname --no-color
INFO The last tag is: v1.2.3.
▶ called kurl::toVar true 200 -H Accept: application/vnd.github.v3+json https://api.github.com/repos/jcaillon/valet/releases/latest
DEBUG Checking if the workarea is clean
▶ called io::invokef5 false 0 git update-index --really-refresh
▶ called io::invokef5 false 0 git diff-index --quiet HEAD
Expand Down Expand Up @@ -457,8 +461,6 @@ SUCCESS The documentation update has been committed.
▶ called io::invoke git add $GLOBAL_VALET_HOME/valet.d/commands.d/self-install.sh
▶ called io::invoke git commit -m :rocket: releasing version 1.2.3
SUCCESS The new version has been committed.
▶ called io::invoke git tag --sort=version:refname --no-color
INFO The last tag is: v1.2.3.
▶ called io::invoke git log --pretty=format:%s v1.2.3..HEAD
INFO The tag message is:
1 ░ # Release of version 1.2.3
Expand All @@ -468,10 +470,15 @@ INFO The tag message is:
5 ░ - ✨ feature
6 ░ - 🐞 fix
7 ░
▶ called io::invoke git push origin main
▶ called io::invoke git tag -a v1.2.3 -m Release version 1.2.3
SUCCESS The new version has been tagged.
▶ called io::invoke git push origin -f main:latest
SUCCESS The distant ⌜latest⌝ branch has been updated.
▶ called io::invoke git push origin main
▶ called io::invoke git push origin v1.2.3
SUCCESS The new version has been tagged and pushed to the remote repository.
SUCCESS The new version has been pushed to the remote repository.
▶ called io::invoke git push origin -f main:latest
SUCCESS The distant ⌜latest⌝ branch has been updated.
DEBUG The release payload is: ⌜{
"tag_name": "v1.2.3",
"body": "# Release of version 1.2.3\n\nChangelog: \n\n- ✨ feature\n- 🐞 fix\n",
Expand All @@ -485,8 +492,6 @@ DEBUG The release payload is: ⌜{
"prerelease": false
} https://api.github.com/repos/jcaillon/valet/releases
SUCCESS The new version has been released on GitHub.
▶ called io::invoke git push origin -f main:latest
SUCCESS The distant ⌜latest⌝ branch has been updated.
DEBUG The upload URL is: https://uploads.github.com/repos/jcaillon/valet/releases/xxxx/assets
▶ called io::invoke cp -R $GLOBAL_VALET_HOME/examples.d .
▶ called io::invoke cp -R $GLOBAL_VALET_HOME/valet.d .
Expand Down
2 changes: 1 addition & 1 deletion valet.d/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.21.567
1.3.1

0 comments on commit c348805

Please sign in to comment.