test: run jmeter test from lnbits-extensions repo (#2374)
* test: run jmeter test from `lnbits-extensions` repo moves the integration tests for extensions into the `lnbits-extensions` repo. more info here: https://github.com/lnbits/lnbits-extensions/pull/283
This commit is contained in:
parent
9b5bb1b07a
commit
c9af15b320
7 changed files with 14 additions and 11003 deletions
64
.github/workflows/jmeter.yml
vendored
64
.github/workflows/jmeter.yml
vendored
|
|
@ -1,4 +1,4 @@
|
|||
name: JMeter Tests
|
||||
name: JMeter Extension Tests
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
|
@ -15,7 +15,7 @@ on:
|
|||
type: string
|
||||
|
||||
jobs:
|
||||
action_build:
|
||||
jmeter:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -24,66 +24,30 @@ jobs:
|
|||
with:
|
||||
python-version: ${{ inputs.python-version }}
|
||||
|
||||
- name: create logs and reports dir
|
||||
run: |
|
||||
mkdir logs
|
||||
mkdir reports
|
||||
|
||||
- name: run LNbits
|
||||
env:
|
||||
LNBITS_ADMIN_UI: true
|
||||
LNBITS_EXTENSIONS_DEFAULT_INSTALL: "watchonly, satspay, tipjar, tpos, lnurlp, withdraw"
|
||||
LNBITS_BACKEND_WALLET_CLASS: FakeWallet
|
||||
run: |
|
||||
poetry run lnbits > logs/lnbits.log &
|
||||
poetry run lnbits &
|
||||
sleep 5
|
||||
|
||||
- name: install jmeter
|
||||
- name: clone lnbits-extensions, install jmeter and run tests
|
||||
run: |
|
||||
java -version
|
||||
wget https://downloads.apache.org//jmeter/binaries/apache-jmeter-5.6.2.zip
|
||||
unzip apache-jmeter-5.6.2.zip
|
||||
$GITHUB_WORKSPACE/apache-jmeter-5.6.2/bin/jmeter -v
|
||||
git clone https://github.com/lnbits/lnbits-extensions
|
||||
cd lnbits-extensions
|
||||
mkdir logs
|
||||
mkdir reports
|
||||
make install-jmeter
|
||||
make start-mirror-server
|
||||
make test
|
||||
|
||||
- name: start mirror server
|
||||
run: |
|
||||
libs_dir=$GITHUB_WORKSPACE/apache-jmeter-5.6.2/lib/
|
||||
echo "Fix bad Jmeter lib names. Lib dir: $libs_dir"
|
||||
|
||||
mv $libs_dir/slf4j-api-1.7.36.jar $libs_dir/slf4j-api-1.7.25.jar
|
||||
mv $libs_dir/log4j-slf4j-impl-2.20.0.jar $libs_dir/log4j-slf4j-impl-2.11.0.jar
|
||||
mv $libs_dir/log4j-api-2.20.0.jar $libs_dir/log4j-api-2.11.1.jar
|
||||
mv $libs_dir/log4j-core-2.20.0.jar $libs_dir/log4j-core-2.11.1.jar
|
||||
mv $libs_dir/log4j-1.2-api-2.20.0.jar $libs_dir/og4j-1.2-api-2.11.1.jar
|
||||
|
||||
echo "Starting the mirror server on dfault port 8081."
|
||||
$GITHUB_WORKSPACE/apache-jmeter-5.6.2/bin/mirror-server &
|
||||
|
||||
- name: run jmx scripts
|
||||
run: |
|
||||
for file in $( ls $GITHUB_WORKSPACE/integration/*.jmx); do
|
||||
echo "Running test with $file"
|
||||
filename=$(basename "$file" ".jmx")
|
||||
$GITHUB_WORKSPACE/apache-jmeter-5.6.2/bin/jmeter -n -t $file -l logs/$filename.log -e -o reports ;
|
||||
error_count=$(cat jmeter.log | grep -m 1 "summary =" | awk '{print $19}')
|
||||
echo "Error count: '$error_count'"
|
||||
echo "##########"
|
||||
echo "$error_count" == "0"
|
||||
echo "###########$error_count ###########"
|
||||
if [ "$error_count" = "0" ]; then
|
||||
echo "Test $filename OK."
|
||||
rm -r reports/*
|
||||
else
|
||||
echo "Test $filename failed. Error count: '$error_count'."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
- name: upload jmeter test results
|
||||
uses: actions/upload-artifact@v4
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
name: jmeter-test-results
|
||||
name: jmeter-extension-test-results
|
||||
path: |
|
||||
reports/
|
||||
logs/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue