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

How to use START_URL in workflow? #169

Closed MattRey closed 1 year ago

MattRey commented 1 year ago

Have been struggling to get a synthetic triggered with a different start url as described in the docs.

Adding this to my synthetics.yml file triggers the correct test but it only runs on the start url defined in the Synthetic UI, not the one provided in variables:

name: Run Synthetic tests using search query
jobs:
  e2e_testing:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Run Datadog Synthetic tests
        uses: DataDog/synthetics-ci-github-action@v0.15.0
        with:
          api_key: ${{secrets.DD_API_KEY}}
          app_key: ${{secrets.DD_APP_KEY}}
          test_search_query: 'tag:staging'
          variables: 'START_URL=https://mywebsite.com'  // this has no effect

I can trigger it via postman using the Datadog api but I'd appreciate a nudge in the right direction with this one 🙏

Thank you!

Drarig29 commented 1 year ago

Hey @MattRey!

Just want to make sure: do you have a START_URL variable set up in your test?

image

I can trigger it via postman using the Datadog api

Can you show the payload you send with Postman?

MattRey commented 1 year ago

@Drarig29 🤦‍♂️ - I hadn't set the variable in the test! Because I had started off with postman and the api (which has a startUrl property on the json body) I was considering this as a parameter rather than a DD variable. Thanks for the pointer - it is working now 🙌

Drarig29 commented 1 year ago

No worries @MattRey 😁

Just so you know, to override the start url of a test in the CI, you can either:

Closing this issue, glad my pointer helped you!