mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-12 02:32:54 +01:00
Merge branch 'braid/famedly-runners' into 'main'
chore: use Famedly runners See merge request famedly/fluffychat!1039
This commit is contained in:
commit
371d41d1ea
100
.gitlab-ci.yml
100
.gitlab-ci.yml
@ -20,18 +20,30 @@ code_analyze:
|
|||||||
artifacts:
|
artifacts:
|
||||||
reports:
|
reports:
|
||||||
codequality: code-quality-report.json
|
codequality: code-quality-report.json
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
- famedly
|
||||||
|
|
||||||
widget_test:
|
widget_test:
|
||||||
stage: test
|
stage: test
|
||||||
script: [flutter test]
|
script: [flutter test]
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
- famedly
|
||||||
|
|
||||||
# the basic integration test configuration testing FLOSS builds on Synapse
|
# 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}
|
image: registry.gitlab.com/famedly/company/frontend/flutter-dockerimages/integration/stable:${FLUTTER_VERSION}
|
||||||
stage: test
|
stage: test
|
||||||
services:
|
services:
|
||||||
- name: docker:dind
|
- name: docker:dind
|
||||||
alias: docker
|
alias: docker
|
||||||
|
parallel:
|
||||||
|
matrix:
|
||||||
|
- HOMESERVER_IMPLEMENTATION:
|
||||||
|
- synapse
|
||||||
|
- dendrite
|
||||||
|
- conduit
|
||||||
variables:
|
variables:
|
||||||
# activate container-to-container networking
|
# activate container-to-container networking
|
||||||
FF_NETWORK_PER_BUILD: "true"
|
FF_NETWORK_PER_BUILD: "true"
|
||||||
@ -41,82 +53,65 @@ widget_test:
|
|||||||
DOCKER_DRIVER: overlay2
|
DOCKER_DRIVER: overlay2
|
||||||
# Disable TLS since we're running inside local network.
|
# Disable TLS since we're running inside local network.
|
||||||
DOCKER_TLS_CERTDIR: ""
|
DOCKER_TLS_CERTDIR: ""
|
||||||
|
HOMESERVER: "docker"
|
||||||
before_script:
|
before_script:
|
||||||
# start AVD and keep running in background
|
# start AVD and keep running in background
|
||||||
- scripts/integration-start-avd.sh &
|
- scripts/integration-start-avd.sh &
|
||||||
- scripts/integration-prepare-alpine.sh
|
- scripts/integration-prepare-alpine.sh
|
||||||
|
# create test user environment variables
|
||||||
|
- source scripts/integration-create-environment-variables.sh
|
||||||
# create Synapse instance
|
# create Synapse instance
|
||||||
- scripts/integration-server-synapse.sh
|
- scripts/integration-server-${HOMESERVER_IMPLEMENTATION}.sh
|
||||||
# properly set the homeserver IP and create test users
|
# properly set the homeserver IP and create test users
|
||||||
- scripts/integration-prepare-homeserver.sh
|
- scripts/integration-prepare-homeserver.sh
|
||||||
# ensure the homeserver works
|
|
||||||
- curl docker:8008/_matrix/static/ 2> /dev/null | grep "It works! Synapse is running"
|
|
||||||
script:
|
script:
|
||||||
- flutter pub get
|
- flutter pub get
|
||||||
- flutter test integration_test
|
- flutter test integration_test
|
||||||
allow_failure: true
|
|
||||||
tags:
|
tags:
|
||||||
- android
|
- docker
|
||||||
|
- famedly
|
||||||
timeout: 20m
|
timeout: 20m
|
||||||
|
|
||||||
|
|
||||||
|
# integration tests for Linux builds
|
||||||
|
.integration_test_linux:
|
||||||
|
extends: integration_test
|
||||||
|
script:
|
||||||
|
- apk add cmake ninja gtk+3.0-dev clang pkgconf xz-dev libsecret-dev jsoncpp-dev
|
||||||
|
- flutter pub get
|
||||||
|
- flutter test integration_test -d linux
|
||||||
|
|
||||||
# extending the default tests to test the Google-flavored builds
|
# extending the default tests to test the Google-flavored builds
|
||||||
.integration_test_google:
|
integration_test_proprietary:
|
||||||
extends: .integration_test
|
extends: integration_test
|
||||||
script:
|
script:
|
||||||
- git apply ./scripts/enable-android-google-services.patch
|
- git apply ./scripts/enable-android-google-services.patch
|
||||||
- flutter pub get
|
- flutter pub get
|
||||||
- flutter test integration_test
|
- flutter test integration_test
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
# extending the default tests to use Conduit as local homeserver
|
release_mode_launches:
|
||||||
.integration_test_conduit:
|
parallel:
|
||||||
extends: .integration_test
|
matrix:
|
||||||
before_script:
|
- FLAVOR:
|
||||||
# start AVD and keep running in background
|
- floss
|
||||||
- scripts/integration-start-avd.sh &
|
- proprietary
|
||||||
- scripts/integration-prepare-alpine.sh
|
|
||||||
# create Conduit instance
|
|
||||||
- scripts/integration-server-conduit.sh
|
|
||||||
# properly set the homeserver IP and create test users
|
|
||||||
- scripts/integration-prepare-homeserver.sh
|
|
||||||
# ensure the homeserver works
|
|
||||||
- curl docker:8008/_matrix/static/ 2> /dev/null | grep "M_NOT_FOUND" 1> /dev/null && echo "Conduit is running!"
|
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
# extending the default tests to use Dendrite as local homeserver
|
|
||||||
.integration_test_dendrite:
|
|
||||||
extends: .integration_test
|
|
||||||
before_script:
|
|
||||||
# start AVD and keep running in background
|
|
||||||
- scripts/integration-start-avd.sh &
|
|
||||||
- scripts/integration-prepare-alpine.sh
|
|
||||||
# create Dendrite instance
|
|
||||||
- scripts/integration-server-dendrite.sh
|
|
||||||
# properly set the homeserver IP and create test users
|
|
||||||
- scripts/integration-prepare-homeserver.sh
|
|
||||||
# ensure the homeserver works
|
|
||||||
- curl docker:8008/_matrix/static/ 2> /dev/null | grep "404 page not found" 1> /dev/null && echo "Dendrite is running!"
|
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
.release_mode_launches:
|
|
||||||
image: registry.gitlab.com/famedly/company/frontend/flutter-dockerimages/integration/stable:${FLUTTER_VERSION}
|
image: registry.gitlab.com/famedly/company/frontend/flutter-dockerimages/integration/stable:${FLUTTER_VERSION}
|
||||||
stage: test
|
stage: test
|
||||||
|
before_script:
|
||||||
|
- |
|
||||||
|
if [ "$FLAVOR" == "proprietary" ]; then
|
||||||
|
git apply ./scripts/enable-android-google-services.patch
|
||||||
|
fi
|
||||||
script:
|
script:
|
||||||
# start AVD and keep running in background
|
# start AVD and keep running in background
|
||||||
- scripts/integration-start-avd.sh &
|
- scripts/integration-start-avd.sh &
|
||||||
# generate temporary release build configuration and ensure app launches
|
# generate temporary release build configuration and ensure app launches
|
||||||
- scripts/integration-check-release-build.sh
|
- scripts/integration-check-release-build.sh
|
||||||
allow_failure: true
|
|
||||||
tags:
|
tags:
|
||||||
- android
|
- docker
|
||||||
|
- famedly
|
||||||
timeout: 20m
|
timeout: 20m
|
||||||
|
|
||||||
.release_mode_launches_google:
|
|
||||||
extends: .release_mode_launches
|
|
||||||
before_script:
|
|
||||||
- git apply ./scripts/enable-android-google-services.patch
|
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
build_web:
|
build_web:
|
||||||
stage: build
|
stage: build
|
||||||
before_script:
|
before_script:
|
||||||
@ -144,7 +139,8 @@ build_android_debug:
|
|||||||
stage: build
|
stage: build
|
||||||
script: [./scripts/build-android-debug.sh]
|
script: [./scripts/build-android-debug.sh]
|
||||||
tags:
|
tags:
|
||||||
- android
|
- docker
|
||||||
|
- famedly
|
||||||
artifacts:
|
artifacts:
|
||||||
when: on_success
|
when: on_success
|
||||||
paths:
|
paths:
|
||||||
@ -160,7 +156,8 @@ build_android_apk:
|
|||||||
- ./scripts/prepare-android-release.sh
|
- ./scripts/prepare-android-release.sh
|
||||||
script: [./scripts/build-android-apk.sh]
|
script: [./scripts/build-android-apk.sh]
|
||||||
tags:
|
tags:
|
||||||
- android
|
- docker
|
||||||
|
- famedly
|
||||||
artifacts:
|
artifacts:
|
||||||
when: on_success
|
when: on_success
|
||||||
paths:
|
paths:
|
||||||
@ -176,7 +173,8 @@ deploy_playstore_internal:
|
|||||||
- ./scripts/prepare-android-release.sh
|
- ./scripts/prepare-android-release.sh
|
||||||
script: [./scripts/release-playstore-beta.sh]
|
script: [./scripts/release-playstore-beta.sh]
|
||||||
tags:
|
tags:
|
||||||
- android
|
- docker
|
||||||
|
- famedly
|
||||||
artifacts:
|
artifacts:
|
||||||
when: on_success
|
when: on_success
|
||||||
paths:
|
paths:
|
||||||
|
@ -41,8 +41,8 @@ void main() {
|
|||||||
|
|
||||||
final inputs = find.byType(TextField);
|
final inputs = find.byType(TextField);
|
||||||
|
|
||||||
await tester.enterText(inputs.first, Users.alice.name);
|
await tester.enterText(inputs.first, Users.user1.name);
|
||||||
await tester.enterText(inputs.last, Users.alice.password);
|
await tester.enterText(inputs.last, Users.user1.password);
|
||||||
await tester.testTextInput.receiveAction(TextInputAction.done);
|
await tester.testTextInput.receiveAction(TextInputAction.done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -297,7 +297,7 @@ listeners:
|
|||||||
# If you plan to use a reverse proxy, please see
|
# If you plan to use a reverse proxy, please see
|
||||||
# https://matrix-org.github.io/synapse/latest/reverse_proxy.html.
|
# https://matrix-org.github.io/synapse/latest/reverse_proxy.html.
|
||||||
#
|
#
|
||||||
- port: 8008
|
- port: 80
|
||||||
tls: false
|
tls: false
|
||||||
type: http
|
type: http
|
||||||
x_forwarded: false
|
x_forwarded: false
|
||||||
|
@ -1,8 +1,16 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
abstract class Users {
|
abstract class Users {
|
||||||
const Users._();
|
const Users._();
|
||||||
static const alice = User('alice', 'AliceInWonderland');
|
|
||||||
static const bob = User('bob', 'JoWirSchaffenDas');
|
static final user1 = User(
|
||||||
static const trudy = User('trudy', 'HaveIBeenPwned');
|
Platform.environment['USER1_NAME'] ?? 'alice',
|
||||||
|
Platform.environment['USER1_PW'] ?? 'AliceInWonderland',
|
||||||
|
);
|
||||||
|
static final user2 = User(
|
||||||
|
Platform.environment['USER2_NAME'] ?? 'bob',
|
||||||
|
Platform.environment['USER2_PW'] ?? 'JoWirSchaffenDas',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class User {
|
class User {
|
||||||
@ -12,5 +20,5 @@ class User {
|
|||||||
const User(this.name, this.password);
|
const User(this.name, this.password);
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://stackoverflow.com/a/33088657
|
final homeserver =
|
||||||
const homeserver = 'http://10.0.2.2:8008';
|
'http://${Platform.environment['HOMESERVER'] ?? 'localhost'}';
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <emoji_picker_flutter/emoji_picker_flutter_plugin.h>
|
#include <emoji_picker_flutter/emoji_picker_flutter_plugin.h>
|
||||||
#include <file_selector_linux/file_selector_plugin.h>
|
#include <file_selector_linux/file_selector_plugin.h>
|
||||||
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
|
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
|
||||||
|
#include <flutter_webrtc/flutter_web_r_t_c_plugin.h>
|
||||||
#include <handy_window/handy_window_plugin.h>
|
#include <handy_window/handy_window_plugin.h>
|
||||||
#include <record_linux/record_linux_plugin.h>
|
#include <record_linux/record_linux_plugin.h>
|
||||||
#include <url_launcher_linux/url_launcher_plugin.h>
|
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||||
@ -31,6 +32,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
|
|||||||
g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
|
g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
|
||||||
flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
|
flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
|
||||||
|
g_autoptr(FlPluginRegistrar) flutter_webrtc_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterWebRTCPlugin");
|
||||||
|
flutter_web_r_t_c_plugin_register_with_registrar(flutter_webrtc_registrar);
|
||||||
g_autoptr(FlPluginRegistrar) handy_window_registrar =
|
g_autoptr(FlPluginRegistrar) handy_window_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "HandyWindowPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "HandyWindowPlugin");
|
||||||
handy_window_plugin_register_with_registrar(handy_window_registrar);
|
handy_window_plugin_register_with_registrar(handy_window_registrar);
|
||||||
|
@ -8,6 +8,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
|||||||
emoji_picker_flutter
|
emoji_picker_flutter
|
||||||
file_selector_linux
|
file_selector_linux
|
||||||
flutter_secure_storage_linux
|
flutter_secure_storage_linux
|
||||||
|
flutter_webrtc
|
||||||
handy_window
|
handy_window
|
||||||
record_linux
|
record_linux
|
||||||
url_launcher_linux
|
url_launcher_linux
|
||||||
|
@ -685,7 +685,7 @@ packages:
|
|||||||
name: flutter_webrtc
|
name: flutter_webrtc
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.9.14"
|
version: "0.9.17"
|
||||||
fuchsia_remote_debug_protocol:
|
fuchsia_remote_debug_protocol:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -47,7 +47,7 @@ dependencies:
|
|||||||
flutter_secure_storage: ^6.0.0
|
flutter_secure_storage: ^6.0.0
|
||||||
flutter_typeahead: ^4.0.0
|
flutter_typeahead: ^4.0.0
|
||||||
flutter_web_auth: ^0.5.0
|
flutter_web_auth: ^0.5.0
|
||||||
flutter_webrtc: 0.9.14 # Pinned because >0.9.14 add Linux support which lets build fail
|
flutter_webrtc: ^0.9.17
|
||||||
future_loading_dialog: ^0.2.3
|
future_loading_dialog: ^0.2.3
|
||||||
geolocator: ^7.6.2
|
geolocator: ^7.6.2
|
||||||
handy_window: ^0.1.6
|
handy_window: ^0.1.6
|
||||||
|
6
scripts/integration-create-environment-variables.sh
Executable file
6
scripts/integration-create-environment-variables.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
export USER1_NAME="alice"
|
||||||
|
export USER1_PW="AliceInWonderland"
|
||||||
|
export USER2_NAME="bob"
|
||||||
|
export USER2_PW="JoWirSchaffenDas"
|
@ -1,8 +1,35 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
IP_ADDRESS="$(drill docker | grep -m 1 -P "\d+\.\d+\.\d+.\d+" | awk -F ' ' '{print $NF}')"
|
|
||||||
|
|
||||||
sed -i "s/10.0.2.2/$IP_ADDRESS/g" integration_test/users.dart
|
if [ -z $HOMESERVER ]; then
|
||||||
|
echo "Please ensure HOMESERVER environment variable is set to the IP or hostname of the homeserver."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z $USER1_NAME ]; then
|
||||||
|
echo "Please ensure USER1_NAME environment variable is set to first user name."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z $USER1_PW ]; then
|
||||||
|
echo "Please ensure USER1_PW environment variable is set to first user password."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z $USER2_NAME ]; then
|
||||||
|
echo "Please ensure USER2_NAME environment variable is set to second user name."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z $USER2_PW ]; then
|
||||||
|
echo "Please ensure USER2_PW environment variable is set to second user password."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
curl -XPOST -d '{"username":"alice", "password":"AliceInWonderland", "inhibit_login":true, "auth": {"type":"m.login.dummy"}}' "http://$IP_ADDRESS:8008/_matrix/client/r0/register"
|
echo "Waiting for homeserver to be available... (GET http://$HOMESERVER/_matrix/client/v3/login)"
|
||||||
curl -XPOST -d '{"username":"bob", "password":"JoWirSchaffenDas", "inhibit_login":true, "auth": {"type":"m.login.dummy"}}' "http://$IP_ADDRESS:8008/_matrix/client/r0/register"
|
|
||||||
curl -XPOST -d '{"username":"trudy", "password":"HaveIBeenPwned", "inhibit_login":true, "auth": {"type":"m.login.dummy"}}' "http://$IP_ADDRESS:8008/_matrix/client/r0/register"
|
while ! curl -XGET "http://$HOMESERVER/_matrix/client/v3/login" >/dev/null 2>/dev/null; do
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Homeserver is up."
|
||||||
|
|
||||||
|
# create users
|
||||||
|
|
||||||
|
curl -fS --retry 3 -XPOST -d "{\"username\":\"$USER1_NAME\", \"password\":\"$USER1_PW\", \"inhibit_login\":true, \"auth\": {\"type\":\"m.login.dummy\"}}" "http://$HOMESERVER/_matrix/client/r0/register"
|
||||||
|
curl -fS --retry 3 -XPOST -d "{\"username\":\"$USER2_NAME\", \"password\":\"$USER2_PW\", \"inhibit_login\":true, \"auth\": {\"type\":\"m.login.dummy\"}}" "http://$HOMESERVER/_matrix/client/r0/register"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
docker run -d \
|
docker run -d \
|
||||||
-e CONDUIT_SERVER_NAME="localhost" \
|
-e CONDUIT_SERVER_NAME="localhost" \
|
||||||
-e CONDUIT_PORT="8008" \
|
-e CONDUIT_PORT="8008" \
|
||||||
-e CONDUIT_DATABASE_BACKEND="rocksdb" \
|
-e CONDUIT_DATABASE_BACKEND="rocksdb" \
|
||||||
@ -9,6 +9,4 @@
|
|||||||
-e CONDUIT_TRUSTED_SERVERS="[\"conduit.rs\"]" \
|
-e CONDUIT_TRUSTED_SERVERS="[\"conduit.rs\"]" \
|
||||||
-e CONDUIT_MAX_CONCURRENT_REQUESTS="100" \
|
-e CONDUIT_MAX_CONCURRENT_REQUESTS="100" \
|
||||||
-e CONDUIT_LOG="info,rocket=off,_=off,sled=off" \
|
-e CONDUIT_LOG="info,rocket=off,_=off,sled=off" \
|
||||||
--name conduit -p 8008:8008 matrixconduit/matrix-conduit:latest
|
--name conduit -p 80:8008 matrixconduit/matrix-conduit:latest
|
||||||
|
|
||||||
sleep 20
|
|
||||||
|
@ -10,7 +10,5 @@ docker run --rm --entrypoint="" \
|
|||||||
-tls-cert /mnt/server.crt \
|
-tls-cert /mnt/server.crt \
|
||||||
-tls-key /mnt/server.key
|
-tls-key /mnt/server.key
|
||||||
|
|
||||||
docker run -d --volume="$(pwd)/integration_test/dendrite/data":/etc/dendrite:rw \
|
docker run -d --volume="$(pwd)/integration_test/dendrite/data":/etc/dendrite:rw \
|
||||||
--name dendrite -p 8008:8008 matrixdotorg/dendrite-monolith:latest -really-enable-open-registration
|
--name dendrite -p 80:8008 matrixdotorg/dendrite-monolith:latest -really-enable-open-registration
|
||||||
|
|
||||||
sleep 20
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
chown -R 991:991 integration_test/synapse
|
docker run -d --name synapse --tmpfs /data \
|
||||||
docker run -d --name synapse --user 991:991 --volume="$(pwd)/integration_test/synapse/data":/data:rw -p 8008:8008 matrixdotorg/synapse:latest
|
--volume="$(pwd)/integration_test/synapse/data/homeserver.yaml":/data/homeserver.yaml:rw \
|
||||||
sleep 20
|
--volume="$(pwd)/integration_test/synapse/data/localhost.log.config":/data/localhost.log.config:rw \
|
||||||
|
-p 80:80 matrixdotorg/synapse:latest
|
||||||
|
Loading…
Reference in New Issue
Block a user