synthetics-ci-github-action icon indicating copy to clipboard operation
synthetics-ci-github-action copied to clipboard

Question: Can I run with the `--tunnel` flag?

Open fabioknoedt opened this issue 3 years ago • 5 comments

Can I run with the --tunnel flag? If yes, how? Thank you!

fabioknoedt avatar Nov 14 '22 16:11 fabioknoedt

Hi @fabioknoedt, thank you for your question!

We do not support the tunnel with the GitHub Action today, but we will definitely keep this issue open alongside an internal feature request. If you could provide some additional information that would be great, namely:

  • What version of the GitHub Action are you running?
  • Are you running a local server/environment that the GitHub Action can access?
    • If yes, could you share more details on your setup?

If you could also provide additional information on the use case that would be really appreciated.

peculiarism avatar Nov 14 '22 16:11 peculiarism

Hi @peculiarism! Thanks for the quick answer.

What version of the GitHub Action are you running? v0.8.0

Are you running a local server/environment that the GitHub Action can access? Yes, I am deploying a local instance of my backend in the CI (using Minikube) and then right after that (in the same Github action machine) I try to run my Datadog tests.

If yes, could you share more details on your setup? 1. Start Minikube 2. Deploy all resources to Minikube (wait to be ready) 3. Test local application using curl http://localhost/xxxx (that works) 4. Run Datadog synthetic tests with --tunnel and pass the variable BASE_URL=http://localhost

fabioknoedt avatar Nov 14 '22 16:11 fabioknoedt

@peculiarism btw, I forgot to mention, using the datadog-ci directly works fine:

- name: Run Datadog CLI synthetic tests
   run: |
      export DATADOG_SITE=datadoghq.eu
      export DATADOG_API_KEY=${{secrets.DATADOG_API_KEY}}
      export DATADOG_APP_KEY=${{secrets.DATADOG_APP_KEY}}
      datadog-ci synthetics run-tests --public-id xxx-xxx-xxx --tunnel --variable BASE_URL=http://myapp.minikube

fabioknoedt avatar Nov 14 '22 16:11 fabioknoedt

Thank you for providing more detail, @fabioknoedt!

An alternative approach would be to add a global configuration file to the GitHub Action, like so:

name: Run Synthetics tests with custom config
jobs:
  e2e_testing:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Run Datadog Synthetics tests
        uses: DataDog/[email protected]
        with:
          api_key: ${{secrets.DD_API_KEY}}
          app_key: ${{secrets.DD_APP_KEY}}
          config_path: './synthetics-config.json'

Within the synthetics-config.json file you would then set "tunnel":true (an example configuration can be found here)

Let me know if that works for your needs!

peculiarism avatar Nov 16 '22 08:11 peculiarism

That's a great idea as it would leverage from the GHA cache. Thanks. Let me try that and get back to you.

fabioknoedt avatar Nov 16 '22 09:11 fabioknoedt

Closing, as a solution was posted in the thread.

Drarig29 avatar Sep 10 '24 12:09 Drarig29