mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
try running in parallel
This commit is contained in:
parent
e57ab0a9c6
commit
064a8baeaf
8
.github/workflows/test.yml
vendored
8
.github/workflows/test.yml
vendored
@ -278,6 +278,11 @@ jobs:
|
||||
name: Fullstack tests
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build_test_webapp, build_test_backend, build_test_neo4j]
|
||||
strategy:
|
||||
matrix:
|
||||
# run copies of the current job in parallel
|
||||
jobs: 5
|
||||
job: [0, 1, 2, 3, 4]
|
||||
steps:
|
||||
##########################################################################
|
||||
# CHECKOUT CODE ##########################################################
|
||||
@ -320,8 +325,7 @@ jobs:
|
||||
- name: cypress | Fullstack tests
|
||||
run: |
|
||||
yarn install
|
||||
yarn run cypress:run
|
||||
|
||||
yarn run cypress:run --spec $(cypress/parallel-features.sh ${{ matrix.job }} ${{ matrix.jobs }})
|
||||
##########################################################################
|
||||
# UPLOAD SCREENSHOTS & VIDEO #############################################
|
||||
##########################################################################
|
||||
|
||||
19
cypress/parallel-features.sh
Executable file
19
cypress/parallel-features.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Functions
|
||||
function join_by { local IFS="$1"; shift; echo "$*"; }
|
||||
|
||||
# Arguments:
|
||||
CUR_JOB=$1
|
||||
MAX_JOBS=$2
|
||||
|
||||
# Features
|
||||
FEATURE_LIST=( $(find cypress/integration/ -maxdepth 1 -name "*.feature") )
|
||||
|
||||
# Calculation
|
||||
MAX_FEATURES=$(find cypress/integration/ -maxdepth 1 -name "*.feature" -printf '.' | wc -m)
|
||||
FEATURES_PER_JOB=$(expr $(expr ${MAX_FEATURES} + ${MAX_JOBS} - 1) / ${MAX_JOBS} )
|
||||
FEATURES_SKIP=$(expr $(expr ${CUR_JOB} - 1 ) \* ${FEATURES_PER_JOB} )
|
||||
|
||||
# Comma separated list
|
||||
echo $(join_by , ${FEATURE_LIST[@]:${FEATURES_SKIP}:${FEATURES_PER_JOB}})
|
||||
Loading…
x
Reference in New Issue
Block a user