Coder Social home page Coder Social logo

alai97 / synthetics-ci-github-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from datadog/synthetics-ci-github-action

0.0 0.0 0.0 10.77 MB

Github Action to trigger synthetics tests using the datadog-ci tool.

License: MIT License

TypeScript 98.93% JavaScript 1.07%

synthetics-ci-github-action's Introduction

Overview

Trigger Synthetic tests from your GitHub workflows with the Datadog CI Synthetics command .

Setup

To get started:

  1. Add your Datadog API and Application Keys as secrets to your GitHub repository. For more information, see API and Application Keys.
  2. In your GitHub workflow, use DataDog/synthetics-ci-github-action.

Your workflow can be simple or complex.

Simple workflows

Example workflow using public IDs

name: Run Synthetics tests using the test public IDs
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}}
          public_ids: 'abc-d3f-ghi, jkl-mn0-pqr' 
        

Example workflow using an existing synthetics.json file

name: Run Synthetics tests using an existing synthetics.json file
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}}
        

Note: By default, this workflow runs all the tests listed in {,!(node_modules)/**/}*.synthetics.json files (every file ending with .synthetics.json except for those in the node_modules folder). You can also trigger a list of Synthetics tests by specifying a public_id or using a search query.

Complex workflows

Example workflow using the test_search_query

name: Run Synthetics tests by test tag
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}}
          test_search_query: 'tag:e2e-tests'

Example workflow using a global configuration override with config_path

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'

Inputs

Name Type Requirement Description
api_key string required Your Datadog API key. This key is created by your Datadog organization and should be stored as a secret. Default: none.
app_key string required Your Datadog Application key. This key is created by your Datadog organization and should be stored as a secret. Default: none.
public_ids string optional String of public IDs separated by commas for Synthetic tests you want to trigger. If no value is provided, the action looks for files named with synthetics.json. Default: none.
test_search_query string optional Trigger tests corresponding to a search query. Default: none.
tunnel boolean optional Use the testing tunnel to trigger tests. Default: false.
subdomain string optional The name of the custom subdomain set to access your Datadog application. If the URL used to access Datadog is myorg.datadoghq.com, the subdomain value needs to be set to myorg. Default: app.
files string optional Glob pattern to detect Synthetic tests config files. Default: {,!(node_modules)/**/}*.synthetics.json.
datadog_site string optional The Datadog site. For users in the EU, set to datadoghq.eu. For example: datadoghq.com or datadoghq.eu. Default: datadoghq.com.
config_path string optional The global JSON configuration is used when launching tests. See the example configuration for more details. Default: datadog-ci.json.

Further Reading

Additional helpful documentation, links, and articles:

synthetics-ci-github-action's People

Contributors

alai97 avatar dependabot[bot] avatar etnbrd avatar hfaivre avatar jeremy-lq avatar peculiarism avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.