Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix environment variables for multi-flow runs #2163

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
ANDROID_HOME: /home/runner/androidsdk
ANDROID_SDK_ROOT: /home/runner/androidsdk
ANDROID_OS_IMAGE: system-images;android-28;google_apis;x86_64
MAESTRO_EXAMPLE: test-value

steps:
- name: Enable KVM group perms
Expand Down
5 changes: 5 additions & 0 deletions e2e/workspaces/no-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# No App

For tests that don't require an app to be launched.

Tests of JavaScript or environment variables can be run here.
6 changes: 6 additions & 0 deletions e2e/workspaces/no-app/environment-variables.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
appId: com.example.notused
tags:
- passing
---
# Relies on MAESTRO_EXAMPLE being set in the environment
- assertTrue: ${MAESTRO_EXAMPLE == 'test-value'}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ class TestSuiteInteractor(

// proceed to run all other Flows
executionPlan.flowsToRun.forEach { flow ->
val (result, aiOutput) = runFlow(flow.toFile(), env, maestro, debugOutputPath)
val flowFile = flow.toFile()
val updatedEnv = env
.withInjectedShellEnvVars()
.withDefaultEnvVars(flowFile)
val (result, aiOutput) = runFlow(flowFile, updatedEnv, maestro, debugOutputPath)
aiOutputs.add(aiOutput)

if (result.status == FlowStatus.ERROR) {
Expand Down
Loading