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

Command is invalid when running test prepare command through Azure DevOps task #696

Open
rygo-msft opened this issue Nov 12, 2019 · 11 comments
Labels
bug Test Test CLI

Comments

@rygo-msft
Copy link

Starting last week (11/7 4:00 AM EST) our AppCenterTest runs have been failing to submit from Azure DevOps.

When running in the vs2017-win2016 hosted agent image using the AppCenterTest task, the prepare step has begun failing. It does not appear to be an issue with the task as the command sent to the CLI is identical to what successful jobs were sending.

- task: AppCenterTest@1
  name: RunAppCenterTests
  displayName: 'Test with Visual Studio App Center'
  inputs:
    espressoBuildDirectory: ${{ parameters.appBuildDir }}
    appFile: ${{ parameters.appFile }}
    artifactsDirectory: AppCenterTest
    frameworkOption: espresso
    serverEndpoint: 9015e276-e51e-4284-bcf0-6b56a5517017 #MAM functional test connection
    appSlug: ${{ parameters.appCenterAppId }}
    devices: $(DeviceSelector.Devices)
    runOptions: ${{ parameters.runOptions }}
C:\windows\system32\cmd.exe /D /S /C "D:\a\_tasks\AppCenterTest_ad5cd22a-be4e-48bb-adce-181a32432da5\1.152.1\node_modules\.bin\appcenter.cmd test prepare espresso --artifacts-dir D:\a\1\s\AppCenterTest --build-dir D:\a\1\a\MAM\AppClient.Test.Functional --quiet"
Error: Command test prepare espresso --artifacts-dir D:\a\1\s\AppCenterTest --build-dir D:\a\1\a\MAM\AppClient.Test.Functional --quiet is invalid
@rygo-msft
Copy link
Author

I am also seeing people reporting similar issues in #688

@jpc0001
Copy link

jpc0001 commented Nov 12, 2019

I'm seeing the same thing on a windows-2019 agent for a Xamarin UI Test

@avocaddo
Copy link
Contributor

avocaddo commented Nov 13, 2019

It seems that you are running a node version that is not compatible with the CLI node version.
From my tests, windows-latest is using node (v12.13.0) whereas for now CLI requires node 10.x.

You could try adding the following task before the App Center task to downgrade the agent node version:

- task: UseNode@1
  inputs:
    version: '10.15.1'

@rygo-msft
Copy link
Author

@joabalea thank you for the workaround. Is the issue that AppCenterTest task is not setting its required Node version?
When can we expect a fix for this so that we can remove the work around?

@MouthOfMadness
Copy link

I'm seeing this error with the UITest framework as well.

@Azhimkulov
Copy link

I can't understand how to add:
- task: UseNode@1 inputs: version: '10.15.1'

Can somebody explain to me how to do this?

@avocaddo
Copy link
Contributor

@rygo-msft We are working on prioritizing this and it should be shipped with the next version of the task.

@avocaddo
Copy link
Contributor

@Azhimkulov This should be a task for your AzureDevOps pipeline. If you are using .yaml file, you can just copy past it before the App Center test task (- task: AppCenterTest@1 ... ). If you are using the UI pipeline view, you should be able to search for a task called Use Node.js ecosystem and set it to 10.15.1 (also before your App Center test task):

Screen Shot 2019-11-14 at 15 36 58

@svaldetero
Copy link

@rygo-msft We are working on prioritizing this and it should be shipped with the next version of the task.

It's been almost a year, has this been fixed?

@danwaters
Copy link

Still broken for me too. By the way, the "use node" extension no longer shows up in search at the time of this posting; you need to search for Node.js tool installer

@MouthOfMadness
Copy link

MouthOfMadness commented Nov 30, 2020

I've got mine working in the release pipeline (and I have one working in yaml file), but I'm going to post mine as the release pipeline.

This is what my pipeline looks like, the difference in the way this used to work and the way I have it working, is you now have to run the task twice, once to prepare the test, then to run the test.
image

I came to believe (without proof) that the prepare test generates the manifest file used by the test as this always seemed to be my point of failure (in this folder $(Build.ArtifactStagingDirectory)/AppCenterTest).
image

This is what the yaml looks like for each task in the release pipeline (paths, tools, test-assembly are all relative to your project):

steps:

  • task: UseNode@1
    displayName: 'Use Node 10.15.1'
    inputs:
    version: 10.15.1

  • task: AppCenterTest@1
    displayName: 'Prepare Test with Visual Studio App Center'
    inputs:
    appFile: '$(path)/andriod.apk'
    frameworkOption: uitest
    uiTestBuildDirectory: '$(path)/test-assembly'
    uiTestToolsDirectory: '$(path)/tools'
    serverEndpoint: MyAppCenterUser
    appSlug: 'mySlug'
    devices: 'myDevices'
    skipWaitingForResults: true

  • task: AppCenterTest@1
    displayName: 'Test with Visual Studio App Center'
    inputs:
    appFile: '$(path)/android.apk'
    prepareTests: false
    serverEndpoint: MyAppCenterUser
    appSlug: 'mySlug'
    devices: 'myDevices'
    skipWaitingForResults: true

And a small snippet from my release pipeline:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Test Test CLI
Projects
None yet
Development

No branches or pull requests

9 participants