tweaks to run-tests.sh ro run on mac; wiring in gherkin ui tests to drone
continuous-integration/drone/pr Build is pending Details

This commit is contained in:
Dan Ballard 2022-02-09 11:46:27 -05:00
parent 7e59d1a526
commit 4dd058deb2
3 changed files with 56 additions and 15 deletions

View File

@ -60,6 +60,25 @@ steps:
- tar -czf cwtch-`cat ../VERSION`.tar.gz cwtch
- rm -r cwtch
- name: widget-tests
image: cirrusci/flutter:2.8.0
volumes:
- name: deps
path: /root/.pub-cache
commands:
# - flutter config --enable-linux-desktop
- flutter test --coverage
- genhtml coverage/lcov.info -o coverage/html
- name: ui-tests
image: openpriv/flutter-desktop:linux-fstable-2.8.0
volumes:
- name: deps
path: /root/.pub-cache
commands:
- ./run-tests.sh
- cp integration_test/gherkin/reports/cucumber_report.html deploy/linux_cucumber_report.html
- name: test-build-android
image: cirrusci/flutter:2.8.0
when:
@ -94,15 +113,6 @@ steps:
- cp build/app/outputs/apk/release/app-release.apk deploy/
#- cp build/app/outputs/flutter-apk/app-debug.apk deploy/android
- name: widget-tests
image: cirrusci/flutter:2.8.0
volumes:
- name: deps
path: /root/.pub-cache
commands:
# - flutter config --enable-linux-desktop
- flutter test --coverage
- genhtml coverage/lcov.info -o coverage/html
- name: deploy-buildfiles
image: kroniak/ssh-client
@ -336,6 +346,15 @@ steps:
- mkdir -p deploy
- mv Cwtch.dmg deploy
- name: ui-tests
commands:
- export PATH=$PATH:/Users/Dan/development/flutter/bin
- export GEM_HOME=$HOME/.gem
- export PATH=$GEM_HOME/ruby/2.6.0/bin:$PATH
- flutter doctor
- ./run-tests.sh
- cp integration_test/gherkin/reports/cucumber_report.html deploy/macos_cucumber_report.html
- name: deploy-buildfiles
environment:
BUILDFILES_KEY:

6
.gitignore vendored
View File

@ -40,6 +40,12 @@ app.*.symbols
# Obfuscation related
app.*.map.json
# Gherkin
run-tests.env
test1
test2
testHome
linux/tor
linux/libCwtch.so
android/cwtch/cwtch.aar

View File

@ -1,18 +1,34 @@
#!/bin/bash
OS=$(uname)
DEVICE=linux
if [ "$OS" == "Darwin" ]; then
DEVICE=macos
fi
if [ ! -e run-tests.env ]; then
echo "#!/bin/bash" > run-tests.env
echo "LDPATH=./linux/" >> run-tests.env
echo "HEADLESS=false" >> run-tests.env
if [ "$OS" == "Linux" ]; then
echo "LDPATH=./linux/" >> run-tests.env
else
echo "LDPATH=./" >> run-tests.env
fi
if [ -z $DRONE ]; then
echo "HEADLESS=false" >> run-tests.env
else
echo "HEADLESS=true" >> run-tests.env
fi
fi
source run-tests.env
paths=$(find . -wholename "./integration_test/features/*/$1*.feature" | sort | sed -z "s/\\n/','/g;s/,'$//;s/^/'/")
#paths=$(find . -wholename "./integration_test/features/*/$1*.feature" | sort | sed -z "s/\\n/','/g;s/,'$//;s/^/'/")
# macos sed doesn't have -z
paths=$(find . -wholename "./integration_test/features/*/$1*.feature" | sort | awk '!/0$/{printf $0}/0$/' | sed "s/\.\//','\.\//g;s/^','/'/g;s/$/'/g")
sed "s|featurePaths: REPLACED_BY_SCRIPT|featurePaths: <String>[$paths]|" integration_test/gherkin_suite_test.editable.dart > integration_test/gherkin_suite_test.dart
flutter pub run build_runner clean
# flutter pub run build_runner clean
flutter pub run build_runner build --delete-conflicting-outputs
pkill tor
LD_LIBRARY_PATH=$LDPATH CWTCH_HOME=./integration_test/env/temp/ flutter drive --headless --dart-define TEST_MODE=true --driver=test_driver/integration_test_driver.dart --target=integration_test/gherkin_suite_test.dart
LD_LIBRARY_PATH=$LDPATH DYLD_LIBRARY_PATH=$LDPATH CWTCH_HOME=./integration_test/env/temp/ flutter drive --headless --dart-define TEST_MODE=true --driver=test_driver/integration_test_driver.dart --target=integration_test/gherkin_suite_test.dart -d $DEVICE
node index2.js
if [ "$HEADLESS" = "false" ]; then
xdg-open integration_test/gherkin/reports/cucumber_report.html