Skip to content

Commit

Permalink
Fix browserstack CI (#914)
Browse files Browse the repository at this point in the history
* Pass CI as dart-define.

* Update Makefile

* Update browerstack.yml

* Added echo in make file.

* Trigger CI.

* Update browerstack.yml

* Added logs.
  • Loading branch information
jigar-f authored Sep 24, 2023
1 parent a14bee9 commit 7446734
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/browerstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ jobs:
run: make android-lib ANDROID_ARCH=all

- name: Build APK
env:
CI: "true"
run: |
flutter pub get
echo "CI=true" >> $GITHUB_ENV
make do-android-debug ANDROID_ARCH=all
- name: List files in current directory
Expand Down
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,17 @@ $(MOBILE_TEST_APK) $(MOBILE_TESTS_APK): $(MOBILE_SOURCES) $(MOBILE_ANDROID_LIB)
-b $(MOBILE_DIR)/app/build.gradle \
:app:assembleAutoTestDebug :app:assembleAutoTestDebugAndroidTest

dart-defines-debug:
@DART_DEFINES="$(CIBASE)"; \
printf "$$DART_DEFINES"

do-android-debug: $(MOBILE_SOURCES) $(MOBILE_ANDROID_LIB)
ln -fs $(MOBILE_DIR)/gradle.properties . && \
CI="$$CI" && $(GRADLE) -PlanternVersion=$(DEBUG_VERSION) -PddClientToken=$$DD_CLIENT_TOKEN -PddApplicationID=$$DD_APPLICATION_ID \
@ln -fs $(MOBILE_DIR)/gradle.properties . && \
DART_DEFINES=`make dart-defines-debug` && \
echo "Value of DART_DEFINES is: $$DART_DEFINES" && \
CI="$$CI" && \
echo "Value of CI is: $$CI" && \
$(GRADLE) -Pdart-defines="$$DART_DEFINES" -PlanternVersion=$(DEBUG_VERSION) -PddClientToken=$$DD_CLIENT_TOKEN -PddApplicationID=$$DD_APPLICATION_ID \
-PproServerUrl=$(PRO_SERVER_URL) -PpaymentProvider=$(PAYMENT_PROVIDER) -Pcountry=$(COUNTRY) \
-PplayVersion=$(FORCE_PLAY_VERSION) -PuseStaging=$(STAGING) -PstickyConfig=$(STICKY_CONFIG) \
-PlanternRevisionDate=$(REVISION_DATE) -PandroidArch=$(ANDROID_ARCH) \
Expand Down
3 changes: 0 additions & 3 deletions android/app/libs/liblantern-all.aar

This file was deleted.

4 changes: 2 additions & 2 deletions appium_kotlin/app/src/test/resources/live/live_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"server": "hub-cloud.browserstack.com/wd/hub",
"username": "jigarj_SNsRyw",
"access_key": "dA4yyG26fHbfJxRUYMwr",
"app": "bs://5fb3d71c0a06de7d496ff6fceba612a15e835577",
"app": "bs://ac26c1c990dabab70870c250ec774ec9f63fa350",
"capabilities": {
"automationName": "Flutter",
"setWebContentsDebuggingEnabled": true,
"appium:noReset": true,
"appium:logLevel": true,
"enablePerformanceLogging": true,
"bstack:options": {
"appiumVersion": "2.0.0",
"appiumVersion": "2.0.1",
"networkLogs": true,
"projectName": "Lantern",
"buildName": "Lantern-APK",
Expand Down
3 changes: 2 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import 'package:lantern/common/common.dart';
Future<void> main() async {
// CI will be true only when running appium test
var CI = const String.fromEnvironment('CI', defaultValue: 'false');
print('CI is running $CI');
var boolCI = bool.fromEnvironment("CI", defaultValue: false);
print('Appium CI is running $CI and bool $boolCI');
if (CI == 'true') {
enableFlutterDriverExtension();
}
Expand Down

0 comments on commit 7446734

Please sign in to comment.