Azure devops 如何在Azure Devops中安排Cypress测试?

Azure devops 如何在Azure Devops中安排Cypress测试?,azure-devops,continuous-integration,yaml,cypress,schedule,Azure Devops,Continuous Integration,Yaml,Cypress,Schedule,我的Cypress测试在每次提交后运行,但我希望它们每30分钟运行一次。这是我的YAML文件-。如何管理它们每30分钟运行一次或根据给定的CRON时间运行一次 提交后运行脚本A,但每30分钟运行一次脚本B 您可以向脚本中添加条件。例如: schedules: - cron: "*/30 * * * *" displayName: Every 30 minutes branches: include: - main always: true tri

我的Cypress测试在每次提交后运行,但我希望它们每30分钟运行一次。这是我的YAML文件-。如何管理它们每30分钟运行一次或根据给定的CRON时间运行一次

提交后运行脚本A,但每30分钟运行一次脚本B

您可以向脚本中添加条件。例如:

schedules:
- cron:  "*/30 * * * *"
  displayName: Every 30 minutes
  branches:
    include:
    - main
  always: true
trigger:
- '*'

pool:
  vmImage: ubuntu-latest

steps:
- script: echo script A
  displayName: 'script A'
  condition: eq(variables['Build.Reason'], 'IndividualCI')

- script: echo  script B
  displayName: 'script B'
  condition: eq(variables['Build.Reason'], 'Schedule')
在此示例中:

推送提交时,脚本A将运行,脚本B将被跳过。 脚本B将每30分钟运行一次,脚本A将被跳过。 提交后运行脚本A,但每30分钟运行一次脚本B

您可以向脚本中添加条件。例如:

schedules:
- cron:  "*/30 * * * *"
  displayName: Every 30 minutes
  branches:
    include:
    - main
  always: true
trigger:
- '*'

pool:
  vmImage: ubuntu-latest

steps:
- script: echo script A
  displayName: 'script A'
  condition: eq(variables['Build.Reason'], 'IndividualCI')

- script: echo  script B
  displayName: 'script B'
  condition: eq(variables['Build.Reason'], 'Schedule')
在此示例中:

推送提交时,脚本A将运行,脚本B将被跳过。 脚本B将每30分钟运行一次,脚本A将被跳过。
我希望azure在提交后运行脚本A,但每30分钟运行一次脚本B。您的示例将在提交和30分钟后运行相同的脚本。@AraGalstyan我无法查看您问题中的屏幕截图。请再分享一次这是我的yaml文件,它使用npm run cy:test脚本运行我的测试。但我也想每30分钟运行一个脚本。@AraGalstyan我更新了我的答案,请检查它是否满足您的需要。非常感谢!它救了我!我希望azure在提交后运行脚本A,但每30分钟运行一次脚本B。您的示例将在提交和30分钟后运行相同的脚本。@AraGalstyan我无法查看您问题中的屏幕截图。请再分享一次这是我的yaml文件,它使用npm run cy:test脚本运行我的测试。但我也想每30分钟运行一个脚本。@AraGalstyan我更新了我的答案,请检查它是否满足您的需要。非常感谢!它救了我!