chore: add integration tests
Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
This commit is contained in:
parent
803205b7b7
commit
1992d18a64
18 changed files with 491 additions and 103 deletions
|
|
@ -1,7 +1,9 @@
|
|||
variables:
|
||||
FLUTTER_VERSION: 3.3.9
|
||||
|
||||
image: cirrusci/flutter:${FLUTTER_VERSION}
|
||||
image:
|
||||
name: cirrusci/flutter:${FLUTTER_VERSION}
|
||||
pull_policy: if-not-present
|
||||
|
||||
.shared_windows_runners:
|
||||
tags:
|
||||
|
|
@ -16,7 +18,7 @@ stages:
|
|||
|
||||
code_analyze:
|
||||
stage: test
|
||||
script: [./scripts/code_analyze.sh]
|
||||
script: [ ./scripts/code_analyze.sh ]
|
||||
artifacts:
|
||||
reports:
|
||||
codequality: code-quality-report.json
|
||||
|
|
@ -26,13 +28,13 @@ code_analyze:
|
|||
|
||||
widget_test:
|
||||
stage: test
|
||||
script: [flutter test]
|
||||
script: [ flutter test ]
|
||||
tags:
|
||||
- docker
|
||||
- famedly
|
||||
|
||||
# the basic integration test configuration testing FLOSS builds on Synapse
|
||||
.integration_test:
|
||||
integration_test:
|
||||
image: registry.gitlab.com/famedly/company/frontend/flutter-dockerimages/integration/stable:${FLUTTER_VERSION}
|
||||
stage: test
|
||||
services:
|
||||
|
|
@ -49,15 +51,13 @@ widget_test:
|
|||
FF_NETWORK_PER_BUILD: "true"
|
||||
# Tell docker CLI how to talk to Docker daemon.
|
||||
DOCKER_HOST: tcp://docker:2375/
|
||||
# Use the overlayfs driver for improved performance.
|
||||
DOCKER_DRIVER: overlay2
|
||||
# Use the btrfs driver for improved performance.
|
||||
DOCKER_DRIVER: btrfs
|
||||
# Disable TLS since we're running inside local network.
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
HOMESERVER: "docker"
|
||||
HOMESERVER: docker
|
||||
before_script:
|
||||
# start AVD and keep running in background
|
||||
- scripts/integration-start-avd.sh &
|
||||
- scripts/integration-prepare-alpine.sh
|
||||
- scripts/integration-prepare-host.sh
|
||||
# create test user environment variables
|
||||
- source scripts/integration-create-environment-variables.sh
|
||||
# create Synapse instance
|
||||
|
|
@ -65,31 +65,49 @@ widget_test:
|
|||
# properly set the homeserver IP and create test users
|
||||
- scripts/integration-prepare-homeserver.sh
|
||||
script:
|
||||
# start AVD and keep running in background
|
||||
- scripts/integration-start-avd.sh &
|
||||
- flutter pub get
|
||||
- flutter test integration_test
|
||||
timeout: 20m
|
||||
- scrcpy --no-display --record video.mkv &
|
||||
- flutter test integration_test --dart-define=HOMESERVER=$HOMESERVER --dart-define=USER1_NAME=$USER1_NAME --dart-define=USER2_NAME=$USER2_NAME --dart-define=USER1_PW=$USER1_PW --dart-define=USER2_PW=$USER2_PW || ( sleep 10 && exit 1 )
|
||||
after_script:
|
||||
- ffmpeg -i video.mkv -vf scale=iw/2:-2 -crf 40 -b:v 2000k -preset fast video.mp4 || true
|
||||
timeout: 30m
|
||||
retry: 2
|
||||
artifacts:
|
||||
when: always
|
||||
paths:
|
||||
- video.mp4
|
||||
tags:
|
||||
- docker
|
||||
- famedly
|
||||
|
||||
|
||||
# integration tests for Linux builds
|
||||
### disabled because of Linux headless issues
|
||||
.integration_test_linux:
|
||||
extends: .integration_test
|
||||
image: cirrusci/flutter:${FLUTTER_VERSION}
|
||||
extends: integration_test
|
||||
script:
|
||||
- apk add cmake ninja gtk+3.0-dev clang pkgconf xz-dev libsecret-dev jsoncpp-dev
|
||||
- apt-get update
|
||||
- apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libsecret-1-dev libjsoncpp-dev
|
||||
- flutter pub get
|
||||
- flutter test integration_test -d linux
|
||||
- flutter test integration_test -d linux --dart-define=HOMESERVER=$HOMESERVER --dart-define=USER1_NAME=$USER1_NAME --dart-define=USER2_NAME=$USER2_NAME --dart-define=USER1_PW=$USER1_PW --dart-define=USER2_PW=$USER2_PW || ( sleep 10 && exit 1 )
|
||||
after_script: [ ]
|
||||
artifacts:
|
||||
|
||||
# extending the default tests to test the Google-flavored builds
|
||||
.integration_test_proprietary:
|
||||
extends: .integration_test
|
||||
integration_test_proprietary:
|
||||
extends: integration_test
|
||||
script:
|
||||
# start AVD and keep running in background
|
||||
- scripts/integration-start-avd.sh &
|
||||
- git apply ./scripts/enable-android-google-services.patch
|
||||
- flutter pub get
|
||||
- flutter test integration_test
|
||||
- scrcpy --no-display --record video.mkv &
|
||||
- flutter test integration_test --dart-define=HOMESERVER=$HOMESERVER --dart-define=USER1_NAME=$USER1_NAME --dart-define=USER2_NAME=$USER2_NAME --dart-define=USER1_PW=$USER1_PW --dart-define=USER2_PW=$USER2_PW || ( sleep 10 && exit 1 )
|
||||
|
||||
.release_mode_launches:
|
||||
release_mode_launches:
|
||||
parallel:
|
||||
matrix:
|
||||
- FLAVOR:
|
||||
|
|
@ -99,9 +117,9 @@ widget_test:
|
|||
stage: test
|
||||
before_script:
|
||||
- |
|
||||
if [ "$FLAVOR" == "proprietary" ]; then
|
||||
git apply ./scripts/enable-android-google-services.patch
|
||||
fi
|
||||
if [ "$FLAVOR" == "proprietary" ]; then
|
||||
git apply ./scripts/enable-android-google-services.patch
|
||||
fi
|
||||
script:
|
||||
# start AVD and keep running in background
|
||||
- scripts/integration-start-avd.sh &
|
||||
|
|
@ -115,8 +133,8 @@ widget_test:
|
|||
build_web:
|
||||
stage: build
|
||||
before_script:
|
||||
[sudo apt update && sudo apt install curl -y, ./scripts/prepare-web.sh]
|
||||
script: [./scripts/build-web.sh]
|
||||
[ sudo apt update && sudo apt install curl -y, ./scripts/prepare-web.sh ]
|
||||
script: [ ./scripts/build-web.sh ]
|
||||
artifacts:
|
||||
paths:
|
||||
- build/web/
|
||||
|
|
@ -166,7 +184,7 @@ build_windows:
|
|||
|
||||
build_android_debug:
|
||||
stage: build
|
||||
script: [./scripts/build-android-debug.sh]
|
||||
script: [ ./scripts/build-android-debug.sh ]
|
||||
artifacts:
|
||||
when: on_success
|
||||
paths:
|
||||
|
|
@ -183,7 +201,7 @@ build_android_apk:
|
|||
before_script:
|
||||
- git apply ./scripts/enable-android-google-services.patch
|
||||
- ./scripts/prepare-android-release.sh
|
||||
script: [./scripts/build-android-apk.sh]
|
||||
script: [ ./scripts/build-android-apk.sh ]
|
||||
artifacts:
|
||||
when: on_success
|
||||
paths:
|
||||
|
|
@ -200,7 +218,7 @@ deploy_playstore_internal:
|
|||
before_script:
|
||||
- git apply ./scripts/enable-android-google-services.patch
|
||||
- ./scripts/prepare-android-release.sh
|
||||
script: [./scripts/release-playstore-beta.sh]
|
||||
script: [ ./scripts/release-playstore-beta.sh ]
|
||||
artifacts:
|
||||
when: on_success
|
||||
paths:
|
||||
|
|
@ -267,7 +285,7 @@ build_linux_x86:
|
|||
[
|
||||
sudo apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install keyboard-configuration -y && sudo apt-get install curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libsecret-1-dev libsecret-1-0 librhash0 -y,
|
||||
]
|
||||
script: [./scripts/build-linux.sh]
|
||||
script: [ ./scripts/build-linux.sh ]
|
||||
tags:
|
||||
- docker
|
||||
- famedly
|
||||
|
|
@ -278,9 +296,9 @@ build_linux_x86:
|
|||
|
||||
build_linux_arm64:
|
||||
stage: build
|
||||
before_script: [flutter upgrade]
|
||||
script: [./scripts/build-linux.sh]
|
||||
tags: [docker_arm64]
|
||||
before_script: [ flutter upgrade ]
|
||||
script: [ ./scripts/build-linux.sh ]
|
||||
tags: [ docker_arm64 ]
|
||||
only:
|
||||
- main
|
||||
- tags
|
||||
|
|
@ -292,7 +310,7 @@ build_linux_arm64:
|
|||
|
||||
update_dependencies:
|
||||
stage: build
|
||||
needs: []
|
||||
needs: [ ]
|
||||
tags:
|
||||
- docker
|
||||
only:
|
||||
|
|
@ -374,7 +392,7 @@ deploy_playstore:
|
|||
before_script:
|
||||
- git apply ./scripts/enable-android-google-services.patch
|
||||
- ./scripts/prepare-android-release.sh
|
||||
script: [./scripts/release-playstore.sh]
|
||||
script: [ ./scripts/release-playstore.sh ]
|
||||
resource_group: playstore_release
|
||||
only:
|
||||
- tags
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue