Skip to content

Need to improve debug logging #430

Open
@SilverPreeceSOF

Description

@SilverPreeceSOF

When an issue is encountered with the runner, it is nearly impossible to diagnose what is wrong because almost all useful output is being suppressed. As an example, I am trying to diagnose an AVD creation issue with the following configuration:

      - name: Run Tests in Emulator
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: 27
          target: 'default'
          profile: 'Nexus 5'
          force-avd-creation: 'true'
          sdcard-path-or-size: 64MB
          script: |
            adb wait-for-device
            adb push configs/details.json /sdcard
            adb install -r *.apk
            robot test-cases/HomeComponentsTest.robot

Looking at the error logs, I can see that the AVD is not being created:

Creating AVD.
  /usr/bin/sh -c \echo no | avdmanager create avd --force -n test --abi 'default/x86' --package 'system-images;android-27;default;x86' --device 'Nexus 5' --sdcard '64MB'
  Loading local repository...                                                     
  [=========                              ] 25% Loading local repository...       
  [=========                              ] 25% Fetch remote repository...        
  [=======================================] 100% Fetch remote repository...       
  Error: AVD not created.
  null

However, this is as far as I can go with diagnosis, because when I turn on debug logging the output is identical. Looking again at the commands being run, they all send their output to the void:

/usr/bin/sh -c \yes | sdkmanager --licenses > /dev/null
/usr/bin/sh -c \sdkmanager --install 'build-tools;35.0.0' platform-tools 'platforms;android-27'> /dev/null
/usr/bin/sh -c \sdkmanager --install emulator --channel=0 > /dev/null
/usr/bin/sh -c \sdkmanager --install 'system-images;android-27;default;x86' --channel=0 > /dev/null
/usr/bin/sh -c \echo no | avdmanager create avd --force -n test --abi 'default/x86' --package 'system-images;android-27;default;x86' --device 'Nexus 5' --sdcard '64MB'

This makes diagnosis of issues incredibly difficult. Did I make an error in my config? Did I select an incompatible set of profile, API level, etc? I have no idea. It would be much better if the action would detect debug mode in GitHub and output full logging if it is switched on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions