{"thread":{"id":"51954","subject":"[PATCH] t0000: cover GIT_SKIP_TESTS blindspot","startedAt":"2019-10-02T06:14:56Z","lastAt":"2019-10-08T09:22:51Z","messageCount":2,"participants":["Denton Liu"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"383250","messageId":"08273a0d0deae610b93d7f5eb28b0df5f978bf20.1569996425.git.liu.denton@gmail.com","threadId":"51954","inReplyTo":null,"subject":"[PATCH] t0000: cover GIT_SKIP_TESTS blindspot","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-02T06:14:51Z","receivedAt":"2019-10-02T06:14:56Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Currently, the tests for GIT_SKIP_TESTS do not cover the situation where\nwe skip an entire test suite. Add a test case so we cover this\nblindspot.\n\nSigned-off-by: Denton Liu <liu.denton@gmail.com>\n---\nThis patch was created as a result of me teaching test-lib.sh to\nrecognise GIT_RUN_TESTS as a variable, similar to the --run option. That\npatch is polished up and ready to go but I realised that running\nsomething like\n\n\tmake T=t4???-*.sh -j\n\ncovers all the use cases I was thinking of so I'm abandoning it. If\nanyone has any use for that patch, though, let me know and I can send it\nin.\n\n t/t0000-basic.sh | 17 +++++++++++++++++\n 1 file changed, 17 insertions(+)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex 4c01f60dd3..1c5c75920e 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -391,6 +391,23 @@ test_expect_success 'GIT_SKIP_TESTS sh pattern' \"\n \t)\n \"\n \n+test_expect_success 'GIT_SKIP_TESTS entire suite' \"\n+\t(\n+\t\tGIT_SKIP_TESTS='git' && export GIT_SKIP_TESTS &&\n+\t\trun_sub_test_lib_test git-skip-tests-entire-suite \\\n+\t\t\t'GIT_SKIP_TESTS entire suite' <<-\\\\EOF &&\n+\t\tfor i in 1 2 3\n+\t\tdo\n+\t\t\ttest_expect_success \\\"passing test #\\$i\\\" 'true'\n+\t\tdone\n+\t\ttest_done\n+\t\tEOF\n+\t\tcheck_sub_test_lib_test git-skip-tests-entire-suite <<-\\\\EOF\n+\t\t> 1..0 # SKIP skip all tests in git\n+\t\tEOF\n+\t)\n+\"\n+\n test_expect_success '--run basic' \"\n \trun_sub_test_lib_test run-basic \\\n \t\t'--run basic' --run='1 3 5' <<-\\\\EOF &&\n-- \n2.23.0.248.g3a9dd8fb08\n\n"},{"id":"383667","messageId":"b5f3af8a630aec2d8bffe8e76f1d113171eda250.1570526491.git.liu.denton@gmail.com","threadId":"51954","inReplyTo":"08273a0d0deae610b93d7f5eb28b0df5f978bf20.1569996425.git.liu.denton@gmail.com","subject":"[PATCH v2] t0000: cover GIT_SKIP_TESTS blindspots","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-08T09:22:47Z","receivedAt":"2019-10-08T09:22:51Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Currently, the tests for GIT_SKIP_TESTS do not cover the situation where\nwe skip an entire test suite. The tests also do not cover the situation\nwhere we have GIT_SKIP_TESTS defined but the test suite does not match.\n\nAdd two test cases so we cover this blindspot.\n\nSigned-off-by: Denton Liu <liu.denton@gmail.com>\n---\nChanges since v1:\n\n* Added another test case to cover the blindspot where GIT_SKIP_TESTS is\n  defined but the test suite does not match.\n\nRange-diff against v1:\n1:  08273a0d0d ! 1:  b5f3af8a63 t0000: cover GIT_SKIP_TESTS blindspot\n    @@ Metadata\n     Author: Denton Liu <liu.denton@gmail.com>\n     \n      ## Commit message ##\n    -    t0000: cover GIT_SKIP_TESTS blindspot\n    +    t0000: cover GIT_SKIP_TESTS blindspots\n     \n         Currently, the tests for GIT_SKIP_TESTS do not cover the situation where\n    -    we skip an entire test suite. Add a test case so we cover this\n    -    blindspot.\n    +    we skip an entire test suite. The tests also do not cover the situation\n    +    where we have GIT_SKIP_TESTS defined but the test suite does not match.\n    +\n    +    Add two test cases so we cover this blindspot.\n     \n      ## t/t0000-basic.sh ##\n     @@ t/t0000-basic.sh: test_expect_success 'GIT_SKIP_TESTS sh pattern' \"\n    @@ t/t0000-basic.sh: test_expect_success 'GIT_SKIP_TESTS sh pattern' \"\n     +\t\tEOF\n     +\t)\n     +\"\n    ++\n    ++test_expect_success 'GIT_SKIP_TESTS does not skip unmatched suite' \"\n    ++\t(\n    ++\t\tGIT_SKIP_TESTS='notgit' && export GIT_SKIP_TESTS &&\n    ++\t\trun_sub_test_lib_test git-skip-tests-unmatched-suite \\\n    ++\t\t\t'GIT_SKIP_TESTS does not skip unmatched suite' <<-\\\\EOF &&\n    ++\t\tfor i in 1 2 3\n    ++\t\tdo\n    ++\t\t\ttest_expect_success \\\"passing test #\\$i\\\" 'true'\n    ++\t\tdone\n    ++\t\ttest_done\n    ++\t\tEOF\n    ++\t\tcheck_sub_test_lib_test git-skip-tests-unmatched-suite <<-\\\\EOF\n    ++\t\t> ok 1 - passing test #1\n    ++\t\t> ok 2 - passing test #2\n    ++\t\t> ok 3 - passing test #3\n    ++\t\t> # passed all 3 test(s)\n    ++\t\t> 1..3\n    ++\t\tEOF\n    ++\t)\n    ++\"\n     +\n      test_expect_success '--run basic' \"\n      \trun_sub_test_lib_test run-basic \\\n\n t/t0000-basic.sh | 38 ++++++++++++++++++++++++++++++++++++++\n 1 file changed, 38 insertions(+)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex 4c01f60dd3..4d3f7ba295 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -391,6 +391,44 @@ test_expect_success 'GIT_SKIP_TESTS sh pattern' \"\n \t)\n \"\n \n+test_expect_success 'GIT_SKIP_TESTS entire suite' \"\n+\t(\n+\t\tGIT_SKIP_TESTS='git' && export GIT_SKIP_TESTS &&\n+\t\trun_sub_test_lib_test git-skip-tests-entire-suite \\\n+\t\t\t'GIT_SKIP_TESTS entire suite' <<-\\\\EOF &&\n+\t\tfor i in 1 2 3\n+\t\tdo\n+\t\t\ttest_expect_success \\\"passing test #\\$i\\\" 'true'\n+\t\tdone\n+\t\ttest_done\n+\t\tEOF\n+\t\tcheck_sub_test_lib_test git-skip-tests-entire-suite <<-\\\\EOF\n+\t\t> 1..0 # SKIP skip all tests in git\n+\t\tEOF\n+\t)\n+\"\n+\n+test_expect_success 'GIT_SKIP_TESTS does not skip unmatched suite' \"\n+\t(\n+\t\tGIT_SKIP_TESTS='notgit' && export GIT_SKIP_TESTS &&\n+\t\trun_sub_test_lib_test git-skip-tests-unmatched-suite \\\n+\t\t\t'GIT_SKIP_TESTS does not skip unmatched suite' <<-\\\\EOF &&\n+\t\tfor i in 1 2 3\n+\t\tdo\n+\t\t\ttest_expect_success \\\"passing test #\\$i\\\" 'true'\n+\t\tdone\n+\t\ttest_done\n+\t\tEOF\n+\t\tcheck_sub_test_lib_test git-skip-tests-unmatched-suite <<-\\\\EOF\n+\t\t> ok 1 - passing test #1\n+\t\t> ok 2 - passing test #2\n+\t\t> ok 3 - passing test #3\n+\t\t> # passed all 3 test(s)\n+\t\t> 1..3\n+\t\tEOF\n+\t)\n+\"\n+\n test_expect_success '--run basic' \"\n \trun_sub_test_lib_test run-basic \\\n \t\t'--run basic' --run='1 3 5' <<-\\\\EOF &&\n-- \n2.23.0.248.g3a9dd8fb08\n\n"}]}