Skip to content

Commit 862a83e

Browse files
committed
! cleanup test scripts
1 parent 1654c41 commit 862a83e

7 files changed

+13
-36
lines changed

.github/setup-database.sh

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
set -e
44
set -x
55

6-
DB=$1
7-
86
# Setup a Database
97
if [[ "$DB" == "postgres" ]]
108
then

.github/setup-elkarte.sh

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
set -e
44
set -x
55

6-
DB=$1
7-
PHP_VERSION=$2
8-
96
# Refresh package list upfront
107
sudo apt-get update -qq
118

@@ -15,7 +12,7 @@ sudo apt-get install coreutils memcached -qq > /dev/null
1512
# Webserver setup
1613
if [[ "$DB" != "none" ]]
1714
then
18-
if [[ "$WEBSERVER" != "none" ]]; then .github/setup-nginx.sh $DB $PHP_VERSION; fi
15+
if [[ "$WEBSERVER" != "none" ]]; then .github/setup-nginx.sh "$DB" "$PHP_VERSION"; fi
1916

2017
# Start a memcached service on localhost and the default port so we can test cache engines
2118
memcached -p 11212 -d

.github/setup-failure.sh

+1-6
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77
set -e
88
set +x
99

10-
# Passed params
11-
DB=$1
12-
PHP_VERSION=$2
13-
CODECOV_TOKEN=$3
14-
1510
# Agents will merge all coverage data...
1611
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]
1712
then
18-
bash <(curl -s https://codecov.io/bash) -s "/tmp" -f '*.xml' -t "${CODECOV_TOKEN}"
13+
bash <(curl -s https://codecov.io/bash) -s "/tmp" -f '*.xml' -t "$CODECOV_TOKEN"
1914
fi

.github/setup-nginx.sh

+2-6
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
set -e
44
set -x
55

6-
DB=$1
7-
PHP_VERSION=$2
8-
96
DIR=$(dirname "$0")
107
USER=$(whoami)
118
ELKARTE_ROOT_PATH=$(realpath "$DIR/../elkarte")
@@ -43,11 +40,10 @@ echo "
4340
security.limit_extensions = .php
4441
4542
php_admin_value[memory_limit] = 128M
46-
" > $PHP_FPM_CONF
43+
" > "$PHP_FPM_CONF"
4744

4845
# Add our pool config to PHP-FPM
49-
sudo $PHP_FPM_BIN \
50-
--fpm-config "$DIR/php-fpm.conf"
46+
sudo "$PHP_FPM_BIN" --fpm-config "$DIR/php-fpm.conf"
5147

5248
# Default Nginx conf needs to be updated with correct user
5349
sudo sed -i "s/user www-data;/user $USER;/g" $NGINX_CONF

.github/setup-results.sh

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,14 @@
55
set -e
66
set +x
77

8-
# Passed params
9-
DB=$1
10-
PHP_VERSION=$2
11-
CODECOV_TOKEN=$3
12-
138
# Build a config string for PHPUnit
14-
CONFIG="--verbose --configuration .github/phpunit-${DB}.xml"
9+
CONFIG="--verbose --configuration .github/phpunit-$DB.xml"
1510

1611
# Running PHPUnit tests
1712
vendor/bin/phpunit ${CONFIG}
1813

1914
# Agents will merge all coverage data...
2015
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]
2116
then
22-
bash <(curl -s https://codecov.io/bash) -s "/tmp" -f '*.xml' -t "${CODECOV_TOKEN}"
17+
bash <(curl -s https://codecov.io/bash) -s "/tmp" -f '*.xml' -t "$CODECOV_TOKEN"
2318
fi

.github/setup-selenium.sh

-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
set -e
77
set -x
88

9-
# Access passed params
10-
DB=$1
11-
PHP_VERSION=$2
12-
139
# Some vars to make this easy to change
1410
SELENIUM_HUB_URL='http://127.0.0.1:4444'
1511
SELENIUM_JAR=/usr/share/selenium/selenium-server-standalone.jar

.github/workflows/tests.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
DB: ${{ matrix.db }}
9292
PHP_VERSION: ${{ matrix.php }}
9393
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
94-
run: .github/setup-failure.sh $DB $PHP_VERSION $CODECOV_TOKEN
94+
run: .github/setup-failure.sh
9595
working-directory: ./elkarte
9696

9797
- name: Server Error Log
@@ -223,22 +223,22 @@ jobs:
223223
env:
224224
DB: ${{steps.database-type.outputs.db}}
225225
PHP_VERSION: ${{ matrix.php }}
226-
run: .github/setup-elkarte.sh $DB $PHP_VERSION
226+
run: .github/setup-elkarte.sh
227227
working-directory: ./elkarte
228228

229229
- name: Install Database
230230
env:
231231
DB: ${{steps.database-type.outputs.db}}
232232
PHP_VERSION: ${{ matrix.php }}
233-
run: .github/setup-database.sh $DB $PHP_VERSION
233+
run: .github/setup-database.sh
234234
working-directory: ./elkarte
235235

236236
- name: Run Unit Tests
237237
env:
238238
DB: ${{steps.database-type.outputs.db}}
239239
PHP_VERSION: ${{ matrix.php }}
240240
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
241-
run: .github/setup-results.sh $DB $PHP_VERSION $CODECOV_TOKEN
241+
run: .github/setup-results.sh
242242
working-directory: ./elkarte
243243
# END MySQL and MariaDB Job
244244

@@ -303,21 +303,21 @@ jobs:
303303
env:
304304
DB: ${{steps.database-type.outputs.db}}
305305
PHP_VERSION: ${{ matrix.php }}
306-
run: .github/setup-elkarte.sh $DB $PHP_VERSION
306+
run: .github/setup-elkarte.sh
307307
working-directory: ./elkarte
308308

309309
- name: Install Database
310310
env:
311311
DB: ${{steps.database-type.outputs.db}}
312312
PHP_VERSION: ${{ matrix.php }}
313-
run: .github/setup-database.sh $DB $PHP_VERSION
313+
run: .github/setup-database.sh
314314
working-directory: ./elkarte
315315

316316
- name: Run Unit Tests
317317
env:
318318
DB: ${{steps.database-type.outputs.db}}
319319
PHP_VERSION: ${{ matrix.php }}
320320
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
321-
run: .github/setup-results.sh $DB $PHP_VERSION $CODECOV_TOKEN
321+
run: .github/setup-results.sh
322322
working-directory: ./elkarte
323323
# END Postgres Job

0 commit comments

Comments
 (0)