{"thread":{"id":"24339","subject":"[PATCH] test-lib: Don't write test-results when HARNESS_ACTIVE","startedAt":"2010-07-08T23:34:40Z","lastAt":"2010-08-11T19:37:31Z","messageCount":2,"participants":["Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"145171","messageId":"1278632080-31949-1-git-send-email-avarab@gmail.com","threadId":"24339","inReplyTo":null,"subject":"[PATCH] test-lib: Don't write test-results when HARNESS_ACTIVE","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-08T23:34:40Z","receivedAt":"2010-07-08T23:34:40Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"TAP harnesses don't need to read test-results/*, since they keep track\nof the number of passing/failing tests internally. Skip the generation\nof these files when HARNESS_ACTIVE is set.\n\nIt's now possible to run the Git test suite without writing anything\nto the t/ directory at all if you use a TAP harness and the --root\nswitch:\n\n    cd t\n    sudo mount -t tmpfs none /tmp/memory -o size=300m\n    prove -j9 ./t[0-9]*.sh :: --root=/tmp/memory\n\nThe I/O that the ~500 test-results/* files contributed was very\nminimal, but I thought this was worth mentioning.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/test-lib.sh |   23 +++++++++++++----------\n 1 files changed, 13 insertions(+), 10 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex ac496aa..5f2959f 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -633,16 +633,19 @@ test_create_repo () {\n \n test_done () {\n \tGIT_EXIT_OK=t\n-\ttest_results_dir=\"$TEST_DIRECTORY/test-results\"\n-\tmkdir -p \"$test_results_dir\"\n-\ttest_results_path=\"$test_results_dir/${0%.sh}-$$\"\n-\n-\techo \"total $test_count\" >> $test_results_path\n-\techo \"success $test_success\" >> $test_results_path\n-\techo \"fixed $test_fixed\" >> $test_results_path\n-\techo \"broken $test_broken\" >> $test_results_path\n-\techo \"failed $test_failure\" >> $test_results_path\n-\techo \"\" >> $test_results_path\n+\n+\tif test -z \"$HARNESS_ACTIVE\"; then\n+\t\ttest_results_dir=\"$TEST_DIRECTORY/test-results\"\n+\t\tmkdir -p \"$test_results_dir\"\n+\t\ttest_results_path=\"$test_results_dir/${0%.sh}-$$\"\n+\n+\t\techo \"total $test_count\" >> $test_results_path\n+\t\techo \"success $test_success\" >> $test_results_path\n+\t\techo \"fixed $test_fixed\" >> $test_results_path\n+\t\techo \"broken $test_broken\" >> $test_results_path\n+\t\techo \"failed $test_failure\" >> $test_results_path\n+\t\techo \"\" >> $test_results_path\n+\tfi\n \n \tif test \"$test_fixed\" != 0\n \tthen\n-- \n1.7.0.4\n"},{"id":"147822","messageId":"1281555451-6847-1-git-send-email-avarab@gmail.com","threadId":"24339","inReplyTo":"1278632080-31949-1-git-send-email-avarab@gmail.com","subject":"[PATCH v2] test-lib: Don't write test-results when HARNESS_ACTIVE","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-11T19:37:31Z","receivedAt":"2010-08-11T19:37:31Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"TAP harnesses don't need to read test-results/*, since they keep track\nof the number of passing/failing tests internally. Skip the generation\nof these files when HARNESS_ACTIVE is set.\n\nIt's now possible to run the Git test suite without writing anything\nto the t/ directory at all if you use a TAP harness and the --root\nswitch:\n\n    cd t\n    sudo mount -t tmpfs none /tmp/memory -o size=300m\n    prove -j9 ./t[0-9]*.sh :: --root=/tmp/memory\n\nThe I/O that the ~500 test-results/* files contributed was very\nminimal, but I thought this was worth mentioning.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n\nThis one fell through the cracks, and conflicted with Thomas's later\n\"Only run aggregate-results over actual counts\" patch.\n\nPlease apply it, it keeps conflicting with local changes I have to the\ntest-lib.sh\n\n t/test-lib.sh |   23 +++++++++++++----------\n 1 files changed, 13 insertions(+), 10 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 4e73fff..956f1a5 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -646,16 +646,19 @@ test_create_repo () {\n \n test_done () {\n \tGIT_EXIT_OK=t\n-\ttest_results_dir=\"$TEST_DIRECTORY/test-results\"\n-\tmkdir -p \"$test_results_dir\"\n-\ttest_results_path=\"$test_results_dir/${0%.sh}-$$.counts\"\n-\n-\techo \"total $test_count\" >> $test_results_path\n-\techo \"success $test_success\" >> $test_results_path\n-\techo \"fixed $test_fixed\" >> $test_results_path\n-\techo \"broken $test_broken\" >> $test_results_path\n-\techo \"failed $test_failure\" >> $test_results_path\n-\techo \"\" >> $test_results_path\n+\n+\tif test -z \"$HARNESS_ACTIVE\"; then\n+\t\ttest_results_dir=\"$TEST_DIRECTORY/test-results\"\n+\t\tmkdir -p \"$test_results_dir\"\n+\t\ttest_results_path=\"$test_results_dir/${0%.sh}-$$.counts\"\n+\n+\t\techo \"total $test_count\" >> $test_results_path\n+\t\techo \"success $test_success\" >> $test_results_path\n+\t\techo \"fixed $test_fixed\" >> $test_results_path\n+\t\techo \"broken $test_broken\" >> $test_results_path\n+\t\techo \"failed $test_failure\" >> $test_results_path\n+\t\techo \"\" >> $test_results_path\n+\tfi\n \n \tif test \"$test_fixed\" != 0\n \tthen\n-- \n1.7.2.1.295.gdf931\n"}]}