Make WordPress Core


Ignore:
Timestamp:
01/06/2025 10:29:09 AM (2 weeks ago)
Author:
swissspidy
Message:

Build/Test Tools: Expand performance tests setup.

Run tests against Multisite (possible since [58097]) and on single post pages. Also improve cache flushes/resets between iterations.

Props swissspidy, flixos90, desrosj, mukesh27.
Fixes #62725.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/reusable-performance.yml

    r59571 r59577  
    22# A reusable workflow that runs the performance test suite.
    33##
    4 name: Performance Tests
     4name: Run performance Tests
    55
    66on:
     
    2424      memcached:
    2525        description: 'Whether to enable memcached.'
     26        required: false
     27        type: 'boolean'
     28        default: false
     29      multisite:
     30        description: 'Whether to use Multisite.'
    2631        required: false
    2732        type: 'boolean'
     
    5459  LOCAL_PHP_MEMCACHED: ${{ inputs.memcached }}
    5560  LOCAL_PHP: ${{ inputs.php-version }}${{ 'latest' != inputs.php-version && '-fpm' || '' }}
     61  LOCAL_MULTISITE: ${{ inputs.multisite }}
    5662
    5763jobs:
     
    6672  # - Build WordPress.
    6773  # - Start Docker environment.
     74  # - Install object cache drop-in.
    6875  # - Log running Docker containers.
    6976  # - Docker debug information.
    7077  # - Install WordPress.
     78  # - Enable themes on Multisite.
    7179  # - Install WordPress Importer plugin.
    7280  # - Import mock data.
     
    99107  # - Ensure version-controlled files are not modified or deleted.
    100108  performance:
    101     name: Run tests
     109    name: ${{ inputs.multisite && 'Multisite' || 'Single site' }} / ${{ inputs.memcached && 'Memcached' || 'Default' }}
    102110    runs-on: ubuntu-latest
    103111    permissions:
     
    167175        run: npm run env:install
    168176
     177      - name: Enable themes on Multisite
     178        if: ${{ inputs.multisite }}
     179        run: |
     180          npm run env:cli -- theme enable twentytwentyone --network --path=/var/www/${{ env.LOCAL_DIR }}
     181          npm run env:cli -- theme enable twentytwentythree --network --path=/var/www/${{ env.LOCAL_DIR }}
     182          npm run env:cli -- theme enable twentytwentyfour --network --path=/var/www/${{ env.LOCAL_DIR }}
     183          npm run env:cli -- theme enable twentytwentyfive --network --path=/var/www/${{ env.LOCAL_DIR }}
     184
    169185      - name: Install WordPress Importer plugin
    170186        run: npm run env:cli -- plugin install wordpress-importer --activate --path=/var/www/${{ env.LOCAL_DIR }}
     
    291307        if: always()
    292308        with:
    293           name: performance-artifacts${{ inputs.memcached && '-memcached' || '' }}-${{ github.run_id }}
     309          name: performance-artifacts${{ inputs.multisite && '-multisite' || '' }}${{ inputs.memcached && '-memcached' || '' }}-${{ github.run_id }}
    294310          path: artifacts
    295311          if-no-files-found: ignore
     
    304320      - name: Set the base sha
    305321        # Only needed when publishing results.
    306         if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }}
     322        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached && ! inputs.multisite }}
    307323        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    308324        id: base-sha
     
    315331      - name: Set commit details
    316332        # Only needed when publishing results.
    317         if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }}
     333        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached && ! inputs.multisite }}
    318334        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    319335        id: commit-timestamp
     
    326342      - name: Publish performance results
    327343        # Only publish results on pushes to trunk.
    328         if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached }}
     344        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached && ! inputs.multisite }}
    329345        env:
    330346          BASE_SHA: ${{ steps.base-sha.outputs.result }}
Note: See TracChangeset for help on using the changeset viewer.