]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Experimental support for uploading qlog artifacts
authorHugo Landau <hlandau@openssl.org>
Mon, 12 Feb 2024 11:29:14 +0000 (11:29 +0000)
committerHugo Landau <hlandau@openssl.org>
Thu, 21 Mar 2024 17:57:50 +0000 (17:57 +0000)
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23551)

.github/workflows/ci.yml
.github/workflows/cross-compiles.yml
.github/workflows/make-test [new file with mode: 0755]
test/recipes/70-test_quic_multistream.t

index cfab096ddf7d0d63c6116e4f41834dd799aceb84..d7df5e8611a33c64b79b3271c30494b1af9974e0 100644 (file)
@@ -91,7 +91,12 @@ jobs:
         cat /proc/cpuinfo
         ./util/opensslwrap.sh version -c
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
+      run: .github/workflows/make-test
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@basic-gcc"
+        path: artifacts/
 
   basic_clang:
     runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
@@ -108,7 +113,12 @@ jobs:
         cat /proc/cpuinfo
         ./util/opensslwrap.sh version -c
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
+      run: .github/workflows/make-test
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@basic-clang"
+        path: artifacts/
 
   self-hosted:
     if: github.repository == 'openssl/openssl'
@@ -128,7 +138,12 @@ jobs:
     - name: get cpu info
       run: ./util/opensslwrap.sh version -c
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
+      run: .github/workflows/make-test
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@self-hosted"
+        path: artifacts/
 
   minimal:
     runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
@@ -145,7 +160,13 @@ jobs:
         cat /proc/cpuinfo
         ./util/opensslwrap.sh version -c
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
+      run: .github/workflows/make-test
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@minimal"
+        path: artifacts/
+        if-no-files-found: ignore
 
   no-deprecated:
     runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
@@ -162,7 +183,12 @@ jobs:
         cat /proc/cpuinfo
         ./util/opensslwrap.sh version -c
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
+      run: .github/workflows/make-test
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@no-deprecated"
+        path: artifacts/
 
   no-shared-ubuntu:
     runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
@@ -179,7 +205,12 @@ jobs:
         cat /proc/cpuinfo
         ./util/opensslwrap.sh version -c
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
+      run: .github/workflows/make-test
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@no-shared-ubuntu"
+        path: artifacts/
 
   no-shared-macos:
     runs-on: macos-latest
@@ -197,7 +228,12 @@ jobs:
         sysctl machdep.cpu
         ./util/opensslwrap.sh version -c
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
+      run: .github/workflows/make-test
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@no-shared-macos"
+        path: artifacts/
 
   non-caching:
     runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
@@ -218,7 +254,12 @@ jobs:
         cat /proc/cpuinfo
         ./util/opensslwrap.sh version -c
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0 TESTS="-test_fuzz* -test_ssl_* -test_sslapi -test_evp -test_cmp_http -test_verify -test_cms -test_store -test_enc -[01][0-9]"
+      run: .github/workflows/make-test OPENSSL_TEST_RAND_ORDER=0 TESTS="-test_fuzz* -test_ssl_* -test_sslapi -test_evp -test_cmp_http -test_verify -test_cms -test_store -test_enc -[01][0-9]"
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@non-caching"
+        path: artifacts/
 
   address_ub_sanitizer:
     runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
@@ -239,7 +280,12 @@ jobs:
         cat /proc/cpuinfo
         ./util/opensslwrap.sh version -c
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
+      run: .github/workflows/make-test OPENSSL_TEST_RAND_ORDER=0
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@address_ub_sanitizer"
+        path: artifacts/
 
   fuzz_tests:
     runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
@@ -260,7 +306,13 @@ jobs:
         cat /proc/cpuinfo
         ./util/opensslwrap.sh version -c
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0 TESTS="test_fuzz*"
+      run: .github/workflows/make-test OPENSSL_TEST_RAND_ORDER=0 TESTS="test_fuzz*"
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@fuzz_tests"
+        path: artifacts/
+        if-no-files-found: ignore
 
   memory_sanitizer:
     runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
@@ -282,7 +334,12 @@ jobs:
         cat /proc/cpuinfo
         ./util/opensslwrap.sh version -c
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
+      run: .github/workflows/make-test OPENSSL_TEST_RAND_ORDER=0
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@memory_sanitizer"
+        path: artifacts/
 
   threads_sanitizer:
     runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
@@ -303,7 +360,12 @@ jobs:
         cat /proc/cpuinfo
         ./util/opensslwrap.sh version -c
     - name: make test
-      run: make V=1 TESTS="test_threads test_internal_provider test_provfetch test_provider test_pbe test_evp_kdf test_pkcs12 test_store test_evp test_quic*" test HARNESS_JOBS=${HARNESS_JOBS:-4}
+      run: .github/workflows/make-test V=1 TESTS="test_threads test_internal_provider test_provfetch test_provider test_pbe test_evp_kdf test_pkcs12 test_store test_evp test_quic*"
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@threads_sanitizer"
+        path: artifacts/
 
   enable_non-default_options:
     runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
@@ -322,7 +384,12 @@ jobs:
         cat /proc/cpuinfo
         ./util/opensslwrap.sh version -c
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
+      run: .github/workflows/make-test
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@enable_non-default_options"
+        path: artifacts/
 
   full_featured:
     runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
@@ -347,7 +414,12 @@ jobs:
         cat /proc/cpuinfo
         ./util/opensslwrap.sh version -c
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
+      run: .github/workflows/make-test
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@full_featured"
+        path: artifacts/
 
   no-legacy:
     runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
@@ -364,7 +436,12 @@ jobs:
         cat /proc/cpuinfo
         ./util/opensslwrap.sh version -c
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
+      run: .github/workflows/make-test
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@no-legacy"
+        path: artifacts/
 
   legacy:
     runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
@@ -381,7 +458,12 @@ jobs:
         cat /proc/cpuinfo
         ./util/opensslwrap.sh version -c
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
+      run: .github/workflows/make-test
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@legacy"
+        path: artifacts/
 
   # out-of-source-and-install checks multiple things at the same time:
   # - That building, testing and installing works from an out-of-source
@@ -417,8 +499,13 @@ jobs:
         ./util/opensslwrap.sh version -c
       working-directory: ./build
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
+      run: ../source/.github/workflows/make-test
       working-directory: ./build
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@out-of-readonly-source-and-install-ubuntu"
+        path: build/artifacts/
     - name: make install
       run: make install
       working-directory: ./build
@@ -453,8 +540,13 @@ jobs:
         ./util/opensslwrap.sh version -c
       working-directory: ./build
     - name: make test
-      run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
+      run: ../source/.github/workflows/make-test
       working-directory: ./build
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "ci@out-of-readonly-source-and-install-macos"
+        path: build/artifacts/
     - name: make install
       run: make install
       working-directory: ./build
index c3dd90cab9a0af7885df03e1e6f241404cdb0c63..a452b8a46740c98cda2079921a7a4aa3851fde8a 100644 (file)
@@ -201,18 +201,23 @@ jobs:
     - name: make all tests
       if: github.event_name == 'push' && matrix.platform.tests == ''
       run: |
-        make test HARNESS_JOBS=${HARNESS_JOBS:-4} \
+        .github/workflows/make-test \
                   TESTS="-test_afalg" \
                   QEMU_LD_PREFIX=/usr/${{ matrix.platform.arch }}
     - name: make some tests
       if: github.event_name == 'push' && matrix.platform.tests != 'none' && matrix.platform.tests != ''
       run: |
-        make test HARNESS_JOBS=${HARNESS_JOBS:-4} \
+        .github/workflows/make-test \
                   TESTS="${{ matrix.platform.tests }} -test_afalg" \
                   QEMU_LD_PREFIX=/usr/${{ matrix.platform.arch }}
     - name: make evp tests
       if: github.event_name == 'pull_request' && matrix.platform.tests != 'none'
       run: |
-        make test HARNESS_JOBS=${HARNESS_JOBS:-4} \
+        .github/workflows/make-test \
                   TESTS="test_evp*" \
                   QEMU_LD_PREFIX=/usr/${{ matrix.platform.arch }}
+    - name: save artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: "cross-compiles@${{ matrix.platform.arch }}"
+        path: artifacts/
diff --git a/.github/workflows/make-test b/.github/workflows/make-test
new file mode 100755 (executable)
index 0000000..f77c7af
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+set -eo pipefail
+
+cleanup() {
+    # Remove if nothing was generated.
+    find artifacts -type d -empty -delete
+}
+trap cleanup EXIT
+
+OSSL_CI_ARTIFACTS_PATH="artifacts/"
+if [ -n "${GITHUB_RUN_NUMBER}" ]; then
+    OSSL_CI_ARTIFACTS_PATH="artifacts/github-${GITHUB_JOB}-${GITHUB_RUN_NUMBER}-${GITHUB_RUN_ID}/"
+fi
+mkdir -p "$OSSL_CI_ARTIFACTS_PATH"
+export OSSL_CI_ARTIFACTS_PATH="$(cd "$OSSL_CI_ARTIFACTS_PATH"; pwd)"
+echo Artifacts path is "$OSSL_CI_ARTIFACTS_PATH"
+
+make test HARNESS_JOBS=${HARNESS_JOBS:-4} "$@"
index 4427209a84898db6913862c0ddd6bdd0ae79540f..7257ca09380a7fea060b149aebf594d7c970652e 100644 (file)
@@ -9,17 +9,18 @@
 use OpenSSL::Test qw/:DEFAULT srctop_file result_dir data_file/;
 use OpenSSL::Test::Utils;
 use File::Temp qw(tempfile);
-use File::Path 2.00 qw(rmtree);
+use File::Path 2.00 qw(rmtree mkpath);
 
 setup("test_quic_multistream");
 
 plan skip_all => "QUIC protocol is not supported by this OpenSSL build"
     if disabled('quic');
 
-plan tests => 2;
+plan tests => 3;
 
+my $qlog_output;
 if (!disabled('qlog') && $ENV{OSSL_RUN_CI_TESTS} == "1") {
-    my $qlog_output = result_dir("qlog-output");
+    $qlog_output = result_dir("qlog-output");
     print "# Writing qlog output to $qlog_output\n";
     rmtree($qlog_output, { safe => 1 });
     mkdir($qlog_output);
@@ -43,3 +44,18 @@ SKIP: {
                "running qlog verification script");
     };
 }
+
+SKIP: {
+    skip "no qlog", 1 if disabled('qlog');
+    skip "not running CI tests", 1 unless $ENV{OSSL_RUN_CI_TESTS};
+    skip "not running artifacts upload", 1 unless $ENV{OSSL_CI_ARTIFACTS_PATH};
+
+    subtest "copy qlog artifacts to upload directory" => sub {
+        plan tests => 1;
+
+        my $artifacts_path = $ENV{OSSL_CI_ARTIFACTS_PATH};
+        mkpath("${artifacts_path}/quic_multistream_test");
+        ok(run(cmd(["mv", "--", $qlog_output,
+                    "${artifacts_path}/quic_multistream_test/"])));
+    };
+}