首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Azure DevOps上运行剧作家dotnet测试

在Azure DevOps上运行剧作家dotnet测试
EN

Stack Overflow用户
提问于 2022-05-06 07:12:20
回答 1查看 763关注 0票数 0

我试图在Azure DevOps上使用Nunit框架执行剧作家dotnet测试。当我试图将剧作家作为管道的一部分安装时,我无法执行测试用例,引发一个错误,生成失败,下面的消息

无法使用剧作家找到项目。确保项目或解决方案存在于D:\a\1\s中,或者使用-p提供另一条路径。下面是我的蓝色管道步骤,有人能帮我解决问题的确切位置吗?我已经尝试过Windows和最新的Ubuntu代理

代码语言:javascript
复制
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
- master

pool:
  vmImage: 'windows-latest'

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
- task: UseDotNet@2
  displayName: 'Install .NET'
  inputs:
    packageType: 'sdk'
    version: '6.0.x'
    installationPath: $(Agent.ToolsDirectory)/dotnet
    includePreviewVersions: true

- task: DotNetCoreCLI@2
  inputs:
    command: 'build'
    projects: '**/*.csproj'

- task: DotNetCoreCLI@2
  inputs:
    command: 'custom'
    custom: 'new'
    arguments: 'tool-manifest'
- task: DotNetCoreCLI@2
  displayName: 'Installing Playwright Cli'
  inputs:
    command: 'custom'
    custom: 'tool'
    arguments: 'install Microsoft.Playwright.CLI'

- task: DotNetCoreCLI@2
  displayName: 'Building tests project'
  inputs:
    command: 'build'
    projects: '**/*Tests*.csproj'

- task: DotNetCoreCLI@2
  displayName: Run Playwright Install
  inputs:
    command: custom
    custom: 'tool '
    arguments: run playwright install

- task: DotNetCoreCLI@2
  displayName: 'Run tests'
  inputs:
    command: 'test'
    projects: '**/*Tests*.csproj'
    testRunTitle: 'new pipeline'
EN

回答 1

Stack Overflow用户

发布于 2022-08-16 07:42:35

使用Visual项目,您可以添加构建后事件,这些事件将在生成过程中在开发机器上和Azure管道中运行(使用VSBuild@1进行测试)。

使用VS UI的示例:(您需要为ubuntu调整路径)

代码语言:javascript
复制
echo $(TargetDir).playwright\node\win32_x64\playwright.cmd install
$(TargetDir).playwright\node\win32_x64\playwright.cmd install
echo Done

或直接添加到.csproj中。

代码语言:javascript
复制
  <Target Name="PostBuild" AfterTargets="PostBuildEvent">
    <Exec Command="echo $(TargetDir).playwright\node\win32_x64\playwright.cmd install;$(TargetDir).playwright\node\win32_x64\playwright.cmd install;echo Done" />
  </Target>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72137493

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档