From c348805d05895b6b9ba79258ca93e2d7bebb7d27 Mon Sep 17 00:00:00 2001 From: Julien Caillon Date: Thu, 21 Nov 2024 12:01:38 +0100 Subject: [PATCH] :sparkles: fix tests for release --- tests.d/1002-lib-kurl/results.approved.md | 28 +++++++++---------- tests.d/1103-self-release/01.self-release.sh | 7 +---- tests.d/1103-self-release/results.approved.md | 21 ++++++++------ valet.d/version | 2 +- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/tests.d/1002-lib-kurl/results.approved.md b/tests.d/1002-lib-kurl/results.approved.md index a57e926..8d892df 100644 --- a/tests.d/1002-lib-kurl/results.approved.md +++ b/tests.d/1002-lib-kurl/results.approved.md @@ -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 ⌉ ``` @@ -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 ⌉ ``` @@ -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⌝. ``` @@ -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 ⌉ ``` @@ -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. ⌉ ``` @@ -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⌝. @@ -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 ⌉ ``` @@ -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⌝. @@ -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 ⌉ ``` @@ -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⌝. ``` @@ -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 ⌉ ``` @@ -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⌝. ``` diff --git a/tests.d/1103-self-release/01.self-release.sh b/tests.d/1103-self-release/01.self-release.sh index 6ae4eff..ed69142 100644 --- a/tests.d/1103-self-release/01.self-release.sh +++ b/tests.d/1103-self-release/01.self-release.sh @@ -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 } diff --git a/tests.d/1103-self-release/results.approved.md b/tests.d/1103-self-release/results.approved.md index 907f33e..d4ddab8 100644 --- a/tests.d/1103-self-release/results.approved.md +++ b/tests.d/1103-self-release/results.approved.md @@ -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 @@ -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 @@ -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 @@ -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", @@ -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 . diff --git a/valet.d/version b/valet.d/version index 0fa1ec4..6261a05 100644 --- a/valet.d/version +++ b/valet.d/version @@ -1 +1 @@ -0.21.567 \ No newline at end of file +1.3.1 \ No newline at end of file