diff --git a/.github/actions/pmem_test_prepare/action.yml b/.github/actions/pmem_test_prepare/action.yml new file mode 100644 index 00000000000..010cb75d581 --- /dev/null +++ b/.github/actions/pmem_test_prepare/action.yml @@ -0,0 +1,33 @@ +name: PMEM test prepare +description: PMDK testing procedure for self-hosted runners equipped with PMEM +inputs: + ndctl_enable: + description: Build with RAS support + required: false + default: y + fault_injection: + description: Build with the fault injection capability + required: false + default: '0' +runs: + using: composite + steps: + - run: echo 'WORKDIR=utils/gha-runners' >> "$GITHUB_ENV" + shell: bash + - run: | + echo '::group::Get system information' + $WORKDIR/get-system-info.sh + echo '::endgroup::' + shell: bash + + - env: + FAULT_INJECTION: ${{ inputs.fault_injection }} + NDCTL_ENABLE: ${{ inputs.ndctl_enable }} + run: | + echo '::group::Build' + $WORKDIR/build-pmdk.sh + echo '::endgroup::' + shell: bash + + - run: $WORKDIR/../create-testconfig.sh + shell: bash diff --git a/.github/actions/pmem_test_procedure/action.yml b/.github/actions/pmem_test_procedure/action.yml deleted file mode 100644 index cfcda3fd86a..00000000000 --- a/.github/actions/pmem_test_procedure/action.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: PMEM test procedure -description: PMDK testing procedure for self-hosted runners equipped with PMEM -inputs: - build: - description: Build type to be tested - required: true - ndctl_enable: - description: Build with RAS support - required: false - default: y - workdir: - description: Handy variable providing a path to most of the scripts - required: false - default: utils/gha-runners - fault_injection: - description: Build the PMDK with the fault injection capability - required: false - default: '0' - test_label: - description: Limit testing to tests that have the given label assigned - required: false - default: '' -runs: - using: composite - steps: - - name: Get system information - run: ${{ inputs.workdir }}/get-system-info.sh - shell: bash - - - name: Build - env: - FAULT_INJECTION: ${{ inputs.fault_injection }} - NDCTL_ENABLE: ${{ inputs.ndctl_enable }} - run: ${{ inputs.workdir }}/build-pmdk.sh - shell: bash - - - name: Create testconfig files - run: ${{ inputs.workdir }}/../create-testconfig.sh - shell: bash - - - name: Run tests (Bash) - working-directory: src/test - env: - TEST_BUILD: ${{ inputs.build }} - TEST_LABEL: ${{ inputs.test_label }} - run: ./RUNTESTS.sh - shell: bash - - - name: Run tests (Python) - working-directory: src/test - run: | - cmd="./RUNTESTS.py -b ${{ inputs.build }}"; - [ "${{ inputs.test_label }}" != "" ] && - cmd="$cmd --test-label ${{ inputs.test_label }}"; - bash -c "$cmd" - shell: bash diff --git a/.github/actions/pmem_test_run/action.yml b/.github/actions/pmem_test_run/action.yml new file mode 100644 index 00000000000..69ee23158d1 --- /dev/null +++ b/.github/actions/pmem_test_run/action.yml @@ -0,0 +1,48 @@ +name: PMEM test procedure +description: PMDK testing procedure for self-hosted runners equipped with PMEM +inputs: + test_script: + description: | + 'sh' for RUNTESTS.sh, 'py' for RUNTESTS.py. The default is 'both'. + required: false + default: 'both' + build: + description: Build type to be tested. + required: true + test_label: + description: Limit testing to tests that have the given label assigned. + required: false + default: '' + force_enable: + description: Force the use of a specific Valgrind tool. + required: false + default: '' +runs: + using: composite + steps: + - run: echo 'TEST_TYPE=all' >> "$GITHUB_ENV" + shell: bash + - if: inputs.test_script != 'py' # run for 'sh' and 'both' + working-directory: src/test + env: + TEST_BUILD: ${{ inputs.build }} + TEST_LABEL: ${{ inputs.test_label }} + CHECK_TYPE: ${{ inputs.force_enable }} + run: | + echo '::group::Tests Bash' + ./RUNTESTS.sh + echo '::endgroup::' + shell: bash + + - if: inputs.test_script != 'sh' # run for 'py' and 'both' + working-directory: src/test + run: | + echo '::group::Tests Python' + cmd="./RUNTESTS.py -b ${{ inputs.build }} -t $TEST_TYPE"; + [ "${{ inputs.test_label }}" != '' ] && + cmd="$cmd --test-label ${{ inputs.test_label }}"; + [ "${{ inputs.force_enable }}" != '' ] && + cmd="$cmd --force-enable ${{ inputs.force_enable }}"; + bash -c "$cmd" + echo '::endgroup::' + shell: bash diff --git a/.github/workflows/pmem_check.yml b/.github/workflows/pmem_check.yml deleted file mode 100644 index e33e58d58b3..00000000000 --- a/.github/workflows/pmem_check.yml +++ /dev/null @@ -1,73 +0,0 @@ -# Run short and medium tests (as defined in test frameworks), equivalent to 'make check'. -# -# This workflow is run on 'self-hosted' runners. -name: PMEM check - -on: - workflow_dispatch: - workflow_call: - -jobs: - linux: - name: PMEM_check - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [[self-hosted, rhel],[self-hosted, opensuse]] - build: ['debug', 'nondebug'] - # static builds are tested in a limited scope - include: - - os: [self-hosted, rhel] - build: 'static_debug' - - os: [self-hosted, rhel] - build: 'static_nondebug' - - steps: - - name: Clone the git repo - uses: actions/checkout@v3 - with: - repository: pmem/pmdk - - - name: Test procedure - uses: ./.github/actions/pmem_test_procedure - with: - build: ${{ matrix.build }} - - - # Test the fault injection scenarios on PMem - fault_injection: - name: PMEM fault injection - runs-on: [self-hosted, rhel] - - steps: - - name: Clone the git repo - uses: actions/checkout@v3 - with: - repository: pmem/pmdk - - - name: Test procedure - uses: ./.github/actions/pmem_test_procedure - with: - build: nondebug # only the production build is considered - fault_injection: '1' - test_label: 'fault_injection' # only dedicated scenarios - - - # This build is only viable as long as DAOS builds PMDK with NDCTL_ENABLE=n - # https://github.com/daos-stack/pmdk/pull/12 - ndctl_enable_n: - name: PMEM without ndctl - runs-on: [self-hosted, rhel] - - steps: - - name: Clone the git repo - uses: actions/checkout@v3 - with: - repository: pmem/pmdk - - - name: Test procedure - uses: ./.github/actions/pmem_test_procedure - with: - build: nondebug # only the production build is considered - ndctl_enable: n diff --git a/.github/workflows/pmem_long.yml b/.github/workflows/pmem_long.yml deleted file mode 100644 index f5d93d35377..00000000000 --- a/.github/workflows/pmem_long.yml +++ /dev/null @@ -1,41 +0,0 @@ -# Run tests of type 'long' (as defined in test frameworks). -# -# This workflow is run on 'self-hosted' runners. -name: PMEM long - -on: - workflow_dispatch: - schedule: - - cron: '5 0 * * 6' # At 00:05 on Saturday. - -jobs: - linux: - name: PMEM_long - if: github.repository == 'pmem/pmdk' - runs-on: ${{ matrix.os }} - timeout-minutes: 960 - strategy: - fail-fast: false - matrix: - os: [[self-hosted, rhel],[self-hosted, opensuse]] - script: ['sh', 'py'] - build: [ 'debug', 'nondebug'] - - env: - WORKDIR: utils/gha-runners - - steps: - - name: Clone the git repo - uses: actions/checkout@v3 - - - name: Get system information - run: ./$WORKDIR/get-system-info.sh - - - name: Build - run: ./$WORKDIR/build-pmdk.sh - - - name: Create testconfig file - run: ./$WORKDIR/../create-testconfig.sh - - - name: Run tests - run: cd src/test/ && ./RUNTESTS.${{ matrix.script }} -t long -b ${{ matrix.build }} diff --git a/.github/workflows/pmem_tests.yml b/.github/workflows/pmem_tests.yml new file mode 100644 index 00000000000..345ae1de653 --- /dev/null +++ b/.github/workflows/pmem_tests.yml @@ -0,0 +1,146 @@ +# Run all tests on PMem. +# +# This workflow is run on 'self-hosted' runners. +name: PMEM tests + +on: + workflow_dispatch: + schedule: + # run this job every 8 hours + - cron: '0 */8 * * *' + +jobs: + no_forced_Valgrind: + name: No forced Valgrind + if: github.repository == 'pmem/pmdk' + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [[self-hosted, rhel],[self-hosted, opensuse]] + test_script: ['sh', 'py'] + build: ['debug', 'nondebug'] + force_enable: ['none'] + # static builds are tested in a limited scope + include: + - os: [self-hosted, rhel] + build: 'static_debug' + force_enable: '' # include Valgrind tests + - os: [self-hosted, rhel] + build: 'static_nondebug' + force_enable: '' # include Valgrind tests + env: + WORKDIR: utils/gha-runners + + steps: + - uses: actions/checkout@v3 + + - name: Test prepare + uses: ./.github/actions/pmem_test_prepare + + - name: Test run + uses: ./.github/actions/pmem_test_run + with: + test_script: ${{ matrix.test_script }} + build: ${{ matrix.build }} + force_enable: ${{ matrix.force_enable }} + + + # Test the fault injection scenarios + fault_injection: + name: Fault injection + if: github.repository == 'pmem/pmdk' + runs-on: [self-hosted, rhel] + + steps: + - uses: actions/checkout@v3 + + - name: Test prepare + uses: ./.github/actions/pmem_test_prepare + with: + fault_injection: '1' + + - name: Test run + uses: ./.github/actions/pmem_test_run + with: + build: nondebug # only the production build is considered + test_label: 'fault_injection' # only dedicated scenarios + + + # This build is only viable as long as DAOS builds PMDK with NDCTL_ENABLE=n + # https://github.com/daos-stack/pmdk/pull/12 + ndctl_enable_n: + name: Without ndctl + if: github.repository == 'pmem/pmdk' + runs-on: [self-hosted, rhel] + + steps: + - uses: actions/checkout@v3 + + - name: Test prepare + uses: ./.github/actions/pmem_test_prepare + with: + ndctl_enable: n + + - name: Test run + uses: ./.github/actions/pmem_test_run + with: + build: nondebug # only the production build is considered + + + forced_xmemcheck: + name: Forced memcheck/pmemcheck + if: github.repository == 'pmem/pmdk' + needs: [no_forced_Valgrind, fault_injection, ndctl_enable_n] + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [[self-hosted, rhel],[self-hosted, opensuse]] + test_script: ['sh', 'py'] + build: ['debug', 'nondebug'] + force_enable: ['pmemcheck', 'memcheck'] + env: + WORKDIR: utils/gha-runners + + steps: + - uses: actions/checkout@v3 + + - name: Test prepare + uses: ./.github/actions/pmem_test_prepare + + - name: Test run + uses: ./.github/actions/pmem_test_run + with: + test_script: ${{ matrix.test_script }} + build: ${{ matrix.build }} + force_enable: ${{ matrix.force_enable }} + + + forced_drd_helgrind: + name: Forced drd/helgrind + if: github.repository == 'pmem/pmdk' + needs: forced_xmemcheck + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [[self-hosted, rhel],[self-hosted, opensuse]] + test_script: ['sh', 'py'] + build: ['debug', 'nondebug'] + force_enable: ['drd', 'helgrind'] + env: + WORKDIR: utils/gha-runners + + steps: + - uses: actions/checkout@v3 + + - name: Test prepare + uses: ./.github/actions/pmem_test_prepare + + - name: Test run + uses: ./.github/actions/pmem_test_run + with: + test_script: ${{ matrix.test_script }} + build: ${{ matrix.build }} + force_enable: ${{ matrix.force_enable }} diff --git a/.github/workflows/pmem_tests_main.yml b/.github/workflows/pmem_tests_main.yml deleted file mode 100644 index a0ae1981d2c..00000000000 --- a/.github/workflows/pmem_tests_main.yml +++ /dev/null @@ -1,16 +0,0 @@ -# Run all PMem tests in a sequence -# -# This workflow is run on 'self-hosted' runners. -name: PMEM tests main - -on: - workflow_dispatch: - schedule: - # run this job every 8 hours - - cron: '0 */8 * * *' - -jobs: - call-pmem-check: - uses: ./.github/workflows/pmem_check.yml - name: PMem check - if: github.repository == 'pmem/pmdk' diff --git a/.github/workflows/pmem_valgrind.yml b/.github/workflows/pmem_valgrind.yml deleted file mode 100644 index 161f5059f94..00000000000 --- a/.github/workflows/pmem_valgrind.yml +++ /dev/null @@ -1,42 +0,0 @@ -# Run all tests with 'force-enabled' valgrind. -# -# This workflow is run on 'self-hosted' runners. -name: PMEM Valgrind - -on: - workflow_dispatch: - schedule: - - cron: '0 23 * * 6' # At 23:00 on Saturday. - -jobs: - linux: - name: PMEM_valgrind - if: github.repository == 'pmem/pmdk' - runs-on: ${{ matrix.os }} - timeout-minutes: 4320 # wait max 3 days - strategy: - fail-fast: false - matrix: - script: ['sh', 'py'] - config: ['none', 'drd', 'pmemcheck', 'memcheck', 'helgrind'] - build: ['debug', 'nondebug'] - os: [[self-hosted, rhel],[self-hosted, opensuse]] - - env: - WORKDIR: utils/gha-runners - - steps: - - name: Clone the git repo - uses: actions/checkout@v3 - - - name: Get system information - run: ./$WORKDIR/get-system-info.sh - - - name: Build - run: ./$WORKDIR/build-pmdk.sh - - - name: Create testconfig file - run: ./$WORKDIR/../create-testconfig.sh - - - name: Run tests - run: cd src/test/ && ./RUNTESTS.${{ matrix.script }} --force-enable ${{ matrix.config }} -b ${{ matrix.build }} diff --git a/src/test/RUNTESTS.sh b/src/test/RUNTESTS.sh index 5a60c024b30..2975b0e6176 100755 --- a/src/test/RUNTESTS.sh +++ b/src/test/RUNTESTS.sh @@ -383,6 +383,7 @@ verbose_tests= [ -n "$TEST_BUILD" ] && def_buildtype=$TEST_BUILD [ -n "$TEST_TYPE" ] && testtype=$TEST_TYPE [ -n "$TEST_FS" ] && fstype=$TEST_FS +[ -n "$CHECK_TYPE" ] && checktype=$CHECK_TYPE [ -n "$TEST_TIMEOUT" ] && runtest_timeout=$TEST_TIMEOUT [ -n "$KEEP_GOING" ] && keep_going=$KEEP_GOING [ -n "$VERBOSE_TESTS" ] && verbose_tests="$VERBOSE_TESTS" diff --git a/src/test/unittest/test_types.py b/src/test/unittest/test_types.py index 262ae13567d..116e204b9e8 100644 --- a/src/test/unittest/test_types.py +++ b/src/test/unittest/test_types.py @@ -24,3 +24,7 @@ class Long(_TestType): class Check(_TestType): includes = [Short, Medium] + + +class All(_TestType): + includes = [Short, Medium, Long]