git-l10n / git-po-helper

Helper program for checking l10n contributions
Other
15 stars 6 forks source link

test: exit with failure if downloading test repo fails #6

Closed fangyi-zhou closed 3 years ago

fangyi-zhou commented 3 years ago

When downloading or unzipping git.tar.gz fails for whatever reason, fail the test with an error instead of emitting a warning.

Addresses https://github.com/git-l10n/git-po-helper/issues/5, fixes commit 128b61b (test: do not exit if fail to verify git.tar.gz, 2021-05-14)

Signed-off-by: Fangyi Zhou me@fangyi.io

jiangxin commented 3 years ago

How about remove lockfile using trap:

@@ -15,6 +15,10 @@ Darwin)
        ;;
 esac

+cleanup_test_repository_lock () {
+       rm -f "${PO_HELPER_TEST_REPOSITORY}.lock"
+}
+
 create_test_repository () {
        # create lock
        lockmsg="locked by $$"
@@ -30,6 +34,7 @@ create_test_repository () {

                else
                        echo "$lockmsg" >"${PO_HELPER_TEST_REPOSITORY}.lock"
+                       trap cleanup_test_repository_lock exit
                fi
        done
jiangxin commented 3 years ago

I made some cleanup for the repository by removing "test/example/*.po" files. Please cherry-pick your commit.

fangyi-zhou commented 3 years ago

Not sure why I'm getting test failures when running locally, did I break anything by accident?

jiangxin commented 3 years ago

Not sure why I'm getting test failures when running locally, did I break anything by accident?

Your pull request is the first contribution for this project, great! I need to enable CI manunulay, and the CI passed without any problem. See:

I will merge this PR. You can run the failed test cases using addition '-v' option, like:

sh t00XX-XXXX.sh -v