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

Support for Maestro E2E Tests with New Android Builds Infrastructure #2796

Open
JulienLeal opened this issue Jan 4, 2025 · 2 comments
Open
Labels
eas build needs review Issue is ready to be reviewed by a maintainer

Comments

@JulienLeal
Copy link

JulienLeal commented Jan 4, 2025

Build/Submit details page URL

https://expo.dev/accounts/hashtagbe/projects/componentslib-staging/builds/6a70f1f1-e1a4-4869-bd1c-2a41a5f5980a

Summary

I’m using EAS Build to run Maestro-based E2E tests (following the official guide) and discovered that it currently requires disabling the New Android Builds Infrastructure in Project Settings to enable virtualization for the Android emulator.

However, disabling the new infrastructure might impact my main production pipeline, which I’d prefer to keep on the latest build system.

  • Is support for the new build infrastructure on the roadmap?
  • If I disable it for E2E tests, do I need to maintain two separate pipelines—one for tests (old infra) and one for production (new infra)?
  • Is there any known timeline or workaround to keep everything on the new build infrastructure without losing the ability to run E2E tests?

I love what you’re doing with EAS CLI. This feature would be a huge help for end-to-end test automation workflows!

Thanks in advance for any info or guidance you can provide.

Managed or bare?

managed workflow

Environment

npx expo-env-info:

  expo-env-info 1.2.1 environment info:
    System:
      OS: Linux 5.15 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
      Shell: 5.8.1 - /usr/bin/zsh
    Binaries:
      Node: 18.20.5 - ~/.nvm/versions/node/v18.20.5/bin/node
      Yarn: 1.22.22 - /usr/bin/yarn
      npm: 10.8.2 - ~/.nvm/versions/node/v18.20.5/bin/npm
    IDEs:
      Android Studio: AI-242.23339.11.2421.12700392
    npmPackages:
      expo: ~52.0.18 => 52.0.18 
      react: 18.3.1 => 18.3.1 
      react-dom: 18.3.1 => 18.3.1 
      react-native: 0.76.5 => 0.76.5 
    npmGlobalPackages:
      eas-cli: 14.2.0
    Expo Workflow: bare

Error output

Failed to configure emulator: emulator with required ID not found.

Reproducible demo or steps to reproduce from a blank project

My build-and-maestro-test.yml:

build:
  name: Build and Run Maestro Tests
  steps:
    - eas/build
    - eas/maestro_test:
        inputs:
          flow_path: |
            .maestro/login/loginWithEmailFlow.yaml
            .maestro/login/updateUserFlow.yaml
            .maestro/login/logout.yaml

My build settings:

"build-and-maestro-test": {
      "channel": "sdk52",
      "config": "build-and-maestro-test.yml",
      "android": {
        "buildType": "apk",
        "image": "latest",
        "resourceClass": "large"
      },
      "ios": {
        "simulator": true,
        "image": "latest"
      }
    }

The command that I run: eas build --profile build-and-maestro-test

@JulienLeal JulienLeal added the needs review Issue is ready to be reviewed by a maintainer label Jan 4, 2025
@sjchmiela
Copy link
Contributor

Hey Julien! Congratulations on setting up a build and a Maestro test!

Our latest (and I think better) answer to the need to run a build and then a test is Workflows.

jobs:
  build:
    type: build
    params:
      platform: android
      profile: ???? # use some profile which won't do Maestro tests
  e2e-test:
    type: maestro
    needs: [build]
    params:
      build_id: ${{ needs.build.outputs.build_id }}
      flow_path: |
        .maestro/login/loginWithEmailFlow.yaml
        .maestro/login/updateUserFlow.yaml
        .maestro/login/logout.yaml

Try adding this to .eas/workflows/build-and-test.yml and then running npx -y eas-cli workflow:run build-and-test, I think this should work!


While above is better for orchestrating "a build and then a Maestro test", this won't necessarily help with Failed to configure emulator: emulator with required ID not found.. Not sure what's up with that…

@JulienLeal
Copy link
Author

Hey @sjchmiela, I'll try it. Thanks for this advice !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eas build needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants