HodorNV / ALOps

ALOps
59 stars 24 forks source link

Unit test task throws error when setting filter for test codeunits #607

Closed jfamvg closed 1 year ago

jfamvg commented 1 year ago

I'm trying to run all the available unit-tests that can be found in a docker docker container.

The yml that I'm using looks like this:

steps:
  - task: ALOpsDockerCreate@1
    displayName: 'Create Docker Image'
    inputs:
      artifacttype: ${{ parameters.ArtifactType }}
      artifactversion: ${{ parameters.BcVersion }}
      artifactcountry: ${{ parameters.ArtifactCountry }}
      versionselect: ${{ parameters.VersionSelector }}
      licensefile: '$(BcLicensePath)'
      memory: '6G'
      includetesttoolkit: true
      includetestlibrariesonly: true
      includetestframeworkonly: true

  - task: ALOpsDockerStart@1
    displayName: 'Start Docker Container'

  - task: ALOpsDockerWait@1
    displayName: 'Wait for Docker Container to start'
    inputs:
      search_string: 'Ready for connections!'

  - task: ALOpsAppPublish@1
    displayName: 'Install External Apps'
    inputs:
      usedocker: true
      strictappnames: true
      skip_verification: true
      batch_publish_folder: '$(System.DefaultWorkingDirectory)/ExternalApps/'

  - task: ALOpsAppPublish@1
    displayName: 'Install Customer Apps'
    inputs:
      usedocker: true
      strictappnames: true
      skip_verification: true
      batch_publish_folder: $(Build.ArtifactStagingDirectory)

  - task: ALOpsAppTest@1
    displayName: 'Run TestSuite'
    inputs:
      usedocker: true
      testpage: '130455'
      testfilter: '<> 130411' # Everything exept a microsoft test codeunit
      import_testtoolkit: false
      failed_test_action: 'Ignore'

  - task: PublishTestResults@2
    displayName: 'Publish Test Results **/TestResults.xml'
    inputs:
      testResultsFormat: 'XUnit'
      testResultsFiles: '**/TestResults.xml'
      mergeTestResults: true
      failTaskOnFailedTests: true
      testRunTitle: 'Test Results: $(Build.BuildId)'

  - task: ALOpsDockerRemove@1
    displayName: 'Remove Docker Container'
    enabled: true
    condition: always()

But, unfortunately I get an error when running the task like this: image

All test are perfectly found when I enter the same filter in the page itself: image

I'm looking for a generic way so we don't have to set specific extension IDs or filters for test codeunits. Setting the testfilter like '<> 0' or '<> 130411' would be perfect, but I can't seem to getting that to work.

waldo1001 commented 1 year ago

Good news - we're able to repro this ..

jfamvg commented 1 year ago

I'm glad to hear this! Hope you are able to provide a solution so we can start running unit-tests.

jpreniers commented 1 year ago

Any news when a solution will be provided for this issue?

waldo1001 commented 1 year ago

Hi, can you please try with this latest release?
I remember we put this in the release .. and it should work now.

waldo1001 commented 1 year ago

@jpreniers , any feedback?

jpreniers commented 1 year ago

@waldo1001 Sorry for the late reply. Didn't get a notification. Issue is solved so ticket can closed.