parallel tests
This commit is contained in:
parent
18990b52c0
commit
f60bb650c6
1 changed files with 50 additions and 8 deletions
58
.github/workflows/github_action_test_suite.yml
vendored
58
.github/workflows/github_action_test_suite.yml
vendored
|
|
@ -33,6 +33,7 @@ jobs:
|
||||||
postgresql db: 'evennia'
|
postgresql db: 'evennia'
|
||||||
postgresql user: 'evennia'
|
postgresql user: 'evennia'
|
||||||
postgresql password: 'password'
|
postgresql password: 'password'
|
||||||
|
|
||||||
- name: Set up MySQL server
|
- name: Set up MySQL server
|
||||||
uses: mirromutth/mysql-action@v1.1
|
uses: mirromutth/mysql-action@v1.1
|
||||||
if: ${{ matrix.TESTING_DB == 'mysql'}}
|
if: ${{ matrix.TESTING_DB == 'mysql'}}
|
||||||
|
|
@ -46,16 +47,48 @@ jobs:
|
||||||
mysql database: 'evennia'
|
mysql database: 'evennia'
|
||||||
mysql user: 'evennia'
|
mysql user: 'evennia'
|
||||||
mysql password: 'password'
|
mysql password: 'password'
|
||||||
|
mysql root password: root_password
|
||||||
|
|
||||||
# wait for db to activage, get logs from their start
|
# wait for db to activate
|
||||||
- name: Wait / sleep
|
- name: wait for db to activate
|
||||||
uses: jakejarvis/wait-action@v0.1.0
|
if: matrix.TESTING_DB == 'postgresql' || matrix.TESTING_DB == 'mysql'
|
||||||
if: ${{ matrix.TESTING_DB == 'postgresql' || matrix.TESTING_DB == 'mysql' }}
|
run: |
|
||||||
with:
|
|
||||||
time: '10s'
|
if [ ${{ matrix.TESTING_DB }} = mysql ]
|
||||||
|
then
|
||||||
|
while ! mysqladmin ping -h 127.0.0.1 -u root -proot_password -s >/dev/null 2>&1
|
||||||
|
do
|
||||||
|
sleep 1
|
||||||
|
echo -n .
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
else
|
||||||
|
while ! pg_isready -h 127.0.0.1 -q >/dev/null 2>&1
|
||||||
|
do
|
||||||
|
sleep 1
|
||||||
|
echo -n .
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: mysql privileges
|
||||||
|
if: matrix.TESTING_DB == 'mysql'
|
||||||
|
run: |
|
||||||
|
|
||||||
|
cat <<EOF | mysql -u root -proot_password -h 127.0.0.1 mysql
|
||||||
|
create user 'evennia'@'%' identified by 'password';
|
||||||
|
grant all on \`evennia%\`.* to 'evennia'@'%';
|
||||||
|
grant process on *.* to 'evennia'@'%';
|
||||||
|
flush privileges
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# get logs from db start
|
||||||
- name: Database container logs
|
- name: Database container logs
|
||||||
|
if: matrix.TESTING_DB == 'postgresql' || matrix.TESTING_DB == 'mysql'
|
||||||
uses: jwalton/gh-docker-logs@v1.0.0
|
uses: jwalton/gh-docker-logs@v1.0.0
|
||||||
|
|
||||||
- name: Check running containers
|
- name: Check running containers
|
||||||
|
if: matrix.TESTING_DB == 'postgresql' || matrix.TESTING_DB == 'mysql'
|
||||||
run: docker ps -a
|
run: docker ps -a
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
|
@ -71,6 +104,7 @@ jobs:
|
||||||
pip install mysqlclient
|
pip install mysqlclient
|
||||||
pip install coveralls
|
pip install coveralls
|
||||||
pip install codacy-coverage
|
pip install codacy-coverage
|
||||||
|
pip install tblib
|
||||||
pip install -e .
|
pip install -e .
|
||||||
|
|
||||||
- name: Install extra dependencies
|
- name: Install extra dependencies
|
||||||
|
|
@ -87,7 +121,15 @@ jobs:
|
||||||
- name: Run test suite
|
- name: Run test suite
|
||||||
run: |
|
run: |
|
||||||
cd testing_mygame
|
cd testing_mygame
|
||||||
coverage run --source=../evennia --omit=*/migrations/*,*/urls.py,*/test*.py,*.sh,*.txt,*.md,*.pyc,*.service ../bin/unix/evennia test --settings=settings --keepdb evennia
|
coverage run \
|
||||||
|
--source=../evennia \
|
||||||
|
--omit=*/migrations/*,*/urls.py,*/test*.py,*.sh,*.txt,*.md,*.pyc,*.service \
|
||||||
|
../bin/unix/evennia test \
|
||||||
|
--settings=settings \
|
||||||
|
--keepdb \
|
||||||
|
--parallel auto \
|
||||||
|
--timing \
|
||||||
|
evennia
|
||||||
coverage xml
|
coverage xml
|
||||||
|
|
||||||
# we only want to run coverall/codacy once, so we only do it for one of the matrix combinations
|
# we only want to run coverall/codacy once, so we only do it for one of the matrix combinations
|
||||||
|
|
@ -109,7 +151,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
||||||
coverage-reports: ./testing_mygame/coverage.xml
|
coverage-reports: ./testing_mygame/coverage.xml
|
||||||
|
|
||||||
# docker setup and push
|
# docker setup and push
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue