admin管理员组文章数量:1289496
I'm setting up an end-to-end (E2E) workflow using Maestro in an Expo EAS environment. The following command works perfectly in my local development environment:
maestro test -e APP_ID=myappid
And my maestro.yml
looks like this:
appId: ${APP_ID}
---
- launchApp:
clearState: true
However, when running this in the EAS environment, it fails to find the APP_ID
and throws the following error:
maestro.cli.runner.TestSuiteInteractor.invoke: Launch app "${APP_ID}" with clear state FAILED
It seems like Maestro is not able to resolve the environment variable (APP_ID
) inside the EAS environment.
How can I correctly pass environment variables like APP_ID
to Maestro when running tests in an EAS build? Is there a specific way to ensure that Maestro picks up environment variables in an Expo EAS environment?
Any insights would be greatly appreciated!
Hardcoding the appId
directly in maestro.yml
(which works but is not a viable solution for different environments).
I'm setting up an end-to-end (E2E) workflow using Maestro in an Expo EAS environment. The following command works perfectly in my local development environment:
maestro test -e APP_ID=myappid
And my maestro.yml
looks like this:
appId: ${APP_ID}
---
- launchApp:
clearState: true
However, when running this in the EAS environment, it fails to find the APP_ID
and throws the following error:
maestro.cli.runner.TestSuiteInteractor.invoke: Launch app "${APP_ID}" with clear state FAILED
It seems like Maestro is not able to resolve the environment variable (APP_ID
) inside the EAS environment.
How can I correctly pass environment variables like APP_ID
to Maestro when running tests in an EAS build? Is there a specific way to ensure that Maestro picks up environment variables in an Expo EAS environment?
Any insights would be greatly appreciated!
Hardcoding the appId
directly in maestro.yml
(which works but is not a viable solution for different environments).
1 Answer
Reset to default 1I believe there's is no "clean" solution, at the moment.
As a workaround, to make sure maestro always use the same environment variables as EAS, you might use a command like this to maestro
:
eas env:list --environment=development 2> /dev/null | grep = | sed 's/^/-e /g'
Note: You might want to replace development
by preview
or production
.
This commands will 1) format the output such that -e
is appended before each variable, and 2) suppressing errors
Expected output example :
-e EXPO_PUBLIC_BASE_URL=https://example
-e APP_ID=myappid
Within your package.json
, edit test
script ;
- If you have setup your environment variables within EAS, then use it like above:
maestro test maestro.yml $(eas env:list --environment=development 2> /dev/null | grep = | sed 's/^/-e /g')
- If you have setup your environment variables within an environment file (I personally prefer this one):
maestro test maestro.yml $(cat .env.development | sed -E 's/^(.*)(#.*)$/\1/g' | egrep -v '^(\s*)$' | sed 's/^/-e /g')
This command will 1) ignore comments, 2) ignore blank lines, and 3) append -e
before each variable
本文标签: react nativeHow to pass environment variables to Maestro in Expo EAS buildStack Overflow
版权声明:本文标题:react native - How to pass environment variables to Maestro in Expo EAS build? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741464842a2380251.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论