Skip to content

Commit

Permalink
Remove the use of secrets file
Browse files Browse the repository at this point in the history
  • Loading branch information
tddang-linagora committed Oct 4, 2024
1 parent 8025bec commit 9242e23
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 20 deletions.
3 changes: 0 additions & 3 deletions integration_test/base/test_base.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:tmail_ui_user/main.dart' as app;

class TestBase {
Expand All @@ -10,7 +9,5 @@ class TestBase {
FlutterError.onError = (FlutterErrorDetails details) {
originalOnError(details);
};

await dotenv.load(fileName: 'secrets.env', mergeWith: dotenv.env);
}
}
11 changes: 5 additions & 6 deletions integration_test/tests/compose/send_email_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:patrol/patrol.dart';

Expand All @@ -20,14 +19,14 @@ void main() {
await TestBase().runTestApp();

final loginWithBasicAuthScenario = LoginWithBasicAuth($,
username: dotenv.get('USERNAME'),
hostUrl: dotenv.get('BASIC_AUTH_URL'),
email: dotenv.get('BASIC_AUTH_EMAIL'),
password: dotenv.get('PASSWORD'),
username: const String.fromEnvironment('USERNAME'),
hostUrl: const String.fromEnvironment('BASIC_AUTH_URL'),
email: const String.fromEnvironment('BASIC_AUTH_EMAIL'),
password: const String.fromEnvironment('PASSWORD'),
);
final sendEmailScenario = SendEmail($,
loginWithBasicAuthScenario: loginWithBasicAuthScenario,
additionalRecipient: dotenv.get('ADDITIONAL_MAIL_RECIPIENT'),
additionalRecipient: const String.fromEnvironment('ADDITIONAL_MAIL_RECIPIENT'),
subject: 'Test subject',
content: 'Test content');

Expand Down
9 changes: 4 additions & 5 deletions integration_test/tests/login/login_with_basic_auth_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:patrol/patrol.dart';

Expand All @@ -19,10 +18,10 @@ void main() {
await TestBase().runTestApp();

final loginWithBasicAuthScenario = LoginWithBasicAuth($,
username: dotenv.get('USERNAME'),
hostUrl: dotenv.get('BASIC_AUTH_URL'),
email: dotenv.get('BASIC_AUTH_EMAIL'),
password: dotenv.get('PASSWORD'),
username: const String.fromEnvironment('USERNAME'),
hostUrl: const String.fromEnvironment('BASIC_AUTH_URL'),
email: const String.fromEnvironment('BASIC_AUTH_EMAIL'),
password: const String.fromEnvironment('PASSWORD'),
);

await loginWithBasicAuthScenario.execute();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:patrol/patrol.dart';

Expand All @@ -19,9 +18,9 @@ void main() {
await TestBase().runTestApp();

final loginWithOidcScenario = LoginWithOidc($,
email: dotenv.get('USERNAME'),
password: dotenv.get('PASSWORD'),
hostUrl: dotenv.get('HOST_URL'));
email: const String.fromEnvironment('USERNAME'),
password: const String.fromEnvironment('PASSWORD'),
hostUrl: const String.fromEnvironment('HOST_URL'));

await loginWithOidcScenario.execute();
});
Expand Down
1 change: 0 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ flutter:
- env.file
- configurations/
- configurations/icons/
- secrets.env

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
Expand Down
8 changes: 7 additions & 1 deletion scripts/integration-tests.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/usr/bin/env bash

dart pub global activate patrol_cli
patrol build android
patrol build android \
--dart-define=USERNAME=$USERNAME \
--dart-define=PASSWORD=$PASSWORD \
--dart-define=HOST_URL=$HOST_URL \
--dart-define=ADDITIONAL_MAIL_RECIPIENT=$ADDITIONAL_MAIL_RECIPIENT \
--dart-define=BASIC_AUTH_EMAIL=$BASIC_AUTH_EMAIL \
--dart-define=BASIC_AUTH_URL=$BASIC_AUTH_URL
gcloud firebase test android run \
--type instrumentation \
--app build/app/outputs/apk/debug/app-debug.apk \
Expand Down

0 comments on commit 9242e23

Please sign in to comment.