Azure DevOps管道触发问题消息不消失

时间:2020-11-11 16:15:01

标签: azure-devops yaml azure-devops-pipelines

我们的团队正在实施Azure DevOps测试管道。在我们最初提交创建管道.yml文件之后,显示了此错误消息。研究完之后,我意识到我忘记了在.yml中包含触发器。但是,添加后,此错误消息并未消失。尽管管道按预期方式工作,但我们仅使用手动触发器,如下所示。唯一列出的问题来自我们的原始提交。有没有办法让我确认此错误以使其消失,或者我可能错过了一个我尚未注意到的其他错误?感谢您提前提供的帮助,如果可以提供其他任何信息,请告诉我。

这是当我查看该管道的运行时看到的错误消息。我还提供了如何设置触发器的屏幕截图。 enter image description here

enter image description here

编辑:根据要求,我在下面包括了实际的.yml文件代码,并进行了少许命名修改。我们确实有一些自定义插件,例如为未跟踪但仍需要创建的文件创建文件。因此,您可能需要删除那些以进行测试。

trigger:
- none

pool:
  name: myPool
  demands:
  - msbuild
  - visualstudio

steps:

- task: NuGetToolInstaller@0
  displayName: 'Use NuGet 4.4.1'
  inputs:
    versionSpec: 4.4.1

- task: NuGetCommand@2
  displayName: 'NuGet restore'
  inputs:
    restoreSolution: '$(Parameters.solution)'

- task: eliostruyf.build-task.custom-build-task.file-creator@6
  displayName: 'Create Connection Strings file'
  inputs:
    filepath: '$(System.DefaultWorkingDirectory)/ID_Web/config/ConnectionStrings.config'
    filecontent: |
     <connectionStrings>
     
     </connectionStrings>
     
    endWithNewLine: true

- task: eliostruyf.build-task.custom-build-task.file-creator@6
  displayName: 'Create Developer Settings File'
  inputs:
    filepath: '$(System.DefaultWorkingDirectory)/ID_Web/config/developerAppSettings.config'
    filecontent: |
     <appSettings>

     </appSettings>
    endWithNewLine: true


- task: eliostruyf.build-task.custom-build-task.file-creator@6
  condition: contains(variables['Agent.Name'], '1')
  displayName: 'Create Developer Integration Setting for agent 1'
  inputs:
    filepath: '$(System.DefaultWorkingDirectory)/ID_Test/config/developerIntegrationSettings.config'
    filecontent: |
     <developerIntegrationSettings>
        <add key="ModelsIntegrationTestDb" value="Models_IntegrationTest_BuildAgent1"/>
        <add key="ErrorsIntegrationTestDb" value="Errors_IntegrationTest_BuildAgent1"/>
     </developerIntegrationSettings>
     
    endWithNewLine: true


- task: VisualStudioTestPlatformInstaller@1
  displayName: 'Visual Studio Test Platform Installer'
  inputs:
    versionSelector: latestStable

# Build the solution.
- task: VSBuild@1
  displayName: 'Build solution'
  inputs:
    solution: '$(Parameters.solution)'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"'
    platform: '$(BuildPlatform)'
    configuration: '$(BuildConfiguration)'
    clean: true

# Run all unit tests in parallel
- task: VSTest@2
  displayName: 'Run Unit Tests'
  inputs:
    testAssemblyVer2: |
     **\*ID_Test*.dll
     !**\*TestAdapter.dll
     !**\obj\**
    searchFolder: '$(System.DefaultWorkingDirectory)/ID_Test'
    testFiltercriteria: '(FullyQualifiedName!~Integration & FullyQualifiedName!~Ioc)'
    runOnlyImpactedTests: false
    vsTestVersion: toolsInstaller
    runSettingsFile: 'ID_Test/.runsettings'
    runInParallel: true
    runTestsInIsolation: false
    codeCoverageEnabled: false
    testRunTitle: 'Unit Tests'
    platform: '$(BuildPlatform)'
    configuration: '$(BuildConfiguration)'
    diagnosticsEnabled: true
    rerunFailedTests: true

# Run integration tests serially
- task: VSTest@2
  displayName: 'Run Integration Tests'
  inputs:
    testAssemblyVer2: |
     **\*ID_Test*.dll
     !**\*TestAdapter.dll
     !**\obj\**
    searchFolder: '$(System.DefaultWorkingDirectory)/ID_Test'
    testFiltercriteria: '(FullyQualifiedName~Integration | FullyQualifiedName~Ioc)'
    runOnlyImpactedTests: false
    vsTestVersion: toolsInstaller
    runSettingsFile: 'ID_Test/.runsettings'
    runTestsInIsolation: true
    codeCoverageEnabled: false
    testRunTitle: 'Integration Tests'
    platform: '$(BuildPlatform)'
    configuration: '$(BuildConfiguration)'
    diagnosticsEnabled: true
    rerunFailedTests: true

# Clean agent directories
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
  displayName: 'Clean Agent Directories'

编辑(2):以下是我现在用于触发设置的屏幕快照,最初未被选中。检查它似乎没有任何影响。 enter image description here

2 个答案:

答案 0 :(得分:1)

根据您的描述,此问题看起来更像是一个偶发性问题。在YAML文件中,您不必包含触发器。默认情况下,YAML管道在所有分支上都配置有CI触发器。您可以创建一个新管道并复制YAML文件,以查看是否仍然存在任何错误消息。

或者,该问题可能来自经典UI触发器。在管道编辑页面上,选择“更多操作”->“触发器”。

enter image description here

然后,您可以检查是否存在任何违法行为。如果您想在YAML文件中使用触发器,请保留“ 关闭“从此处关闭YAML持续集成触发器”复选框。

答案 1 :(得分:0)

所以我们放弃了这个问题,因为它没有任何作用,我们也找不到问题。一两个星期后,它才停止显示。因此,我认为这只是Azure DevOps的一个怪癖,而不是管道本身的问题。