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

2024-01-10

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

Here are the error messages that I am seeing when I view the runs of that pipeline. I also included a screen shot of how I'm setting up my trigger. enter image description here

Edit:根据要求,我包含了下面实际的 .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'

Edit (2): Included below is a screen shot of what I am using for trigger settings now, originally it was unchecked. Checking it doesn't seem to have any affect though. enter image description here


我也有同样的情况,当我发现真正的问题时,我正要蜷缩成一团哭泣。正如精彩消息所说,它与触发器完全无关:)

我假设您在将 YAML 文件合并到 master 之前使用 YAML 文件创建了一个新分支用于测试目的。因此,您需要将构建设置为指向此分支,因为该文件在您的主分支上不存在。 步骤如下:

  • 编辑您的管道
  • 单击右上角的 3 个点 > 触发器
  • 单击 YAML 选项卡 > 获取源
  • 将“手动和计划构建的默认分支”更改为指向 .yml 文件所在的分支
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Azure DevOps 管道触发器问题消息不会消失 的相关文章

随机推荐