DataDog / synthetics-ci-github-action

Use Browser and API tests in your CI/CD with Datadog Continuous Testing
https://docs.datadoghq.com/continuous_testing/
Apache License 2.0
41 stars 14 forks source link

Question: How to specify multiple test search query values #157

Closed SwadX closed 1 year ago

SwadX commented 1 year ago

Hello, I am trying to pass multiple search query values in the action but datadog seems to be not able use it properly to find the test.

jobs:
  test:
    timeout-minutes: 60
    runs-on: xxxx
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Run Datadog Synthetic tests
        uses: DataDog/synthetics-ci-github-action@v0.12.0
        with:
          api_key: ${{secrets.DATADOG_API_KEY}}
          app_key: ${{secrets.DATADOG_SERVICE_ACCT_APP_KEY}}
          test_search_query: 'tag:app:cdq'  # <= this works !
          #test_search_query: 'type:browser env:devl team:my-team tag:app:cdq'  <= this doesn't work
          #test_search_query: 'type:browser, env:devl, team:my-team, tag:app:cdq'  <= this doesn't work
SwadX commented 1 year ago

any update on this ?

Drarig29 commented 1 year ago

Hi @SwadX!

Can you post the command output so that we understand what's happening? Does your CI fail because of this?

SwadX commented 1 year ago

@Drarig29 it succeeds but does not find the test.

  with:
    api_key: ***
    app_key: ***
    test_search_query: type:browser, env:devl, team:data-marketplace, tag:app:cdq
    config_path: ./datadog-poc/synthetics-config.json
    tunnel: false

No test to run.
Drarig29 commented 1 year ago

@SwadX I just tried with both:

      - name: Run Datadog Synthetic tests
        uses: DataDog/synthetics-ci-github-action@v0.12.0
        with:
          api_key: ${{ secrets.datadog_api_key }}
          app_key: ${{ secrets.datadog_app_key }}
          config_path: .github/workflows/e2e/global.config.json
          test_search_query: team:example-team type:browser tag:dummy

and

      - name: Run Datadog Synthetic tests
        uses: DataDog/synthetics-ci-github-action@v0.12.0
        with:
          api_key: ${{ secrets.datadog_api_key }}
          app_key: ${{ secrets.datadog_app_key }}
          config_path: .github/workflows/e2e/global.config.json
          test_search_query: 'team:example-team type:browser tag:dummy'

Both of them managed to find the right tests.

However, I also tried with commas and you're right, test_search_query: 'team:example-team, type:browser, tag:dummy' does not work, and I also get "No test to run".


test_search_query: 'tag:app:cdq'  # <= this works !
#test_search_query: 'type:browser env:devl team:my-team tag:app:cdq'  <= this doesn't work
#test_search_query: 'type:browser, env:devl, team:my-team, tag:app:cdq'  <= this doesn't work

Can you double check that test_search_query: 'type:browser env:devl team:my-team tag:app:cdq' (with or without single quotes) actually doesn't work?

SwadX commented 1 year ago

thank you , I was able to fix it. It turned out to be a spelling mistake !