]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: add `--ci` option, show `Env:` only when non-empty
authorViktor Szakats <commit@vsz.me>
Sat, 2 Aug 2025 11:15:28 +0000 (13:15 +0200)
committerViktor Szakats <commit@vsz.me>
Mon, 4 Aug 2025 12:55:10 +0000 (14:55 +0200)
To reduce log noise in local test runs:
- move the `buildinfo.txt` dump and header info lines
  `OS:`, `Perl:`, `diff:` behind a `--ci` `runtests.pl` option.
- enable this option for the CI test targets.
- hide `Env:` header info line if empty.
- merge `Env:` output into a single `logmsg()` call.

Closes #18147

docs/runtests.md
tests/CMakeLists.txt
tests/Makefile.am
tests/globalconfig.pm
tests/runtests.pl

index 5c3c339a1f03a766f252b0b9c13f87e4cbf034f0..0742444c54a0ce852c6cbc834a4d00e96feaa6ba 100644 (file)
@@ -101,6 +101,10 @@ Display test results in automake style output (`PASS/FAIL: [number] [name]`).
 Provide a path to a custom curl binary to run the tests with. Default is the
 curl executable in the build tree.
 
+## `--ci`
+
+Show extra information useful in for CI runs.
+
 ## `-d`
 
 Enable protocol debug: have the servers display protocol output. If used in
index 33c64906e814add3e3b4d20e98bdce3468abe431..56241b889a95928acb962e9fa74d8db5257d1458 100644 (file)
@@ -120,7 +120,7 @@ curl_add_runtests(test-am        "-a -am")
 curl_add_runtests(test-full      "-a -p -r")
 # ~flaky means that it ignores results of tests using the flaky keyword
 curl_add_runtests(test-nonflaky  "-a -p ~flaky ~timing-dependent")
-curl_add_runtests(test-ci        "-a -p ~flaky ~timing-dependent -r --retry=5 -j20")
+curl_add_runtests(test-ci        "-a -p ~flaky ~timing-dependent -r --retry=5 -j20 --ci")
 curl_add_runtests(test-torture   "-a -t -j20")
 curl_add_runtests(test-event     "-a -e")
 
index 91102004d0b7b0aaa3248f6ee56bd7b6d013a71f..3894355fe9fa33ed1d7af56f77542b73584b91a5 100644 (file)
@@ -129,7 +129,7 @@ TEST_E = -a -e
 TEST_NF = -a -p ~flaky ~timing-dependent
 
 # special CI target derived from nonflaky with CI-specific flags
-TEST_CI = $(TEST_NF) -r --retry=5 -j20
+TEST_CI = $(TEST_NF) -r --retry=5 -j20 --ci
 
 PYTEST = pytest
 endif
index 83c4ccbaeded37a06f1a8d4f5cb40541d5dc26f7..9fa436d8bb86aa63e1436e4e14e1b4c68f9f9772 100644 (file)
@@ -46,6 +46,7 @@ BEGIN {
         $TUNITDIR
         $SRVDIR
         $listonly
+        $ci
         $LOCKDIR
         $LOGDIR
         $memanalyze
@@ -94,6 +95,7 @@ our $verbose;         # 1 to show verbose test output
 our $torture;         # 1 to enable torture testing
 our $proxy_address;   # external HTTP proxy address
 our $listonly;        # only list the tests
+our $ci;              # show extra info useful in CI runs
 our $run_duphandle;   # run curl with --test-duphandle to verify handle duplication
 our $run_event_based; # run curl with --test-event to test the event API
 our $automakestyle;   # use automake-like test status output format
index dfa35aaea5d08b6f8b31151f5a1fd6be1f3a4f1a..f2e2a6fdb0f21595c8bbca888b66d86b889d7299 100755 (executable)
@@ -872,11 +872,13 @@ sub checksystemfeatures {
            "* Features: $feat\n",
            "* Disabled: $dis\n",
            "* Host: $hostname\n",
-           "* System: $hosttype\n",
-           "* OS: $hostos\n",
-           "* Perl: $^V ($^X)\n",
-           "* diff: $havediff\n",
-           "* Args: $args\n");
+           "* System: $hosttype\n");
+    if($ci) {
+        logmsg("* OS: $hostos\n",
+               "* Perl: $^V ($^X)\n",
+               "* diff: $havediff\n");
+    }
+    logmsg("* Args: $args\n");
 
     if($jobs) {
         # Only show if not the default for now
@@ -890,11 +892,15 @@ sub checksystemfeatures {
         $feature{"TrackMemory"} = 0;
     }
 
-    logmsg sprintf("* Env: %s%s%s%s", $valgrind?"Valgrind ":"",
-                   $run_duphandle?"test-duphandle ":"",
-                   $run_event_based?"event-based ":"",
-                   $nghttpx_h3);
-    logmsg sprintf("%s\n", $libtool?"Libtool ":"");
+    my $env = sprintf("%s%s%s%s%s",
+                      $valgrind?"Valgrind ":"",
+                      $run_duphandle?"test-duphandle ":"",
+                      $run_event_based?"event-based ":"",
+                      $nghttpx_h3,
+                      $libtool?"Libtool ":"");
+    if($env) {
+        logmsg "* Env: $env\n";
+    }
     logmsg "* Seed: $randseed\n";
 }
 
@@ -2423,6 +2429,9 @@ while(@ARGV) {
         # lists the test case names only
         $listonly=1;
     }
+    elsif($ARGV[0] eq "--ci") {
+        $ci=1;
+    }
     elsif($ARGV[0] =~ /^-j(.*)/) {
         # parallel jobs
         $jobs=1;
@@ -2477,6 +2486,7 @@ Usage: runtests.pl [options] [test selection(s)]
   -ac path use this curl only to talk to APIs (currently only CI test APIs)
   -am      automake style output PASS/FAIL: [number] [name]
   -c path  use this curl executable
+  --ci     show extra info useful in for CI runs (e.g. buildinfo.txt dump)
   -d       display server debug info
   -e, --test-event  event-based execution
   --test-duphandle  duplicate handles before use
@@ -2664,7 +2674,7 @@ if(!$listonly) {
 #######################################################################
 # Output information about the curl build
 #
-if(!$listonly) {
+if(!$listonly && $ci) {
     if(open(my $fd, "<", "../buildinfo.txt")) {
         while(my $line = <$fd>) {
             chomp $line;