惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

I
InfoQ
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
B
Blog
罗磊的独立博客
GbyAI
GbyAI
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
宝玉的分享
宝玉的分享
The GitHub Blog
The GitHub Blog
人人都是产品经理
人人都是产品经理
博客园 - Franky
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
博客园 - 聂微东
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
Visual Studio Blog
MyScale Blog
MyScale Blog
Google DeepMind News
Google DeepMind News
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏

Datadog | The Monitor blog

Introducing our open source AI-native SAST Instrument and monitor Boomi integration flows with OpenTelemetry and Datadog Not all index scans are equal: How we cut query latency by over 99% Platform engineering metrics: What to measure and what to ignore Integrate Recorded Future threat intelligence with Datadog Cloud SIEM CI/CD security: threat modeling using a MITRE-style threat matrix CI/CD security: How to secure your GitHub ecosystem Ingress NGINX is EOL: A practical guide for migrating to Kubernetes Gateway API Operating agentic AI with Amazon Bedrock AgentCore and Datadog LLM Observability: Lessons from NTT DATA Introducing the Datadog Code Security MCP Capture and analyze custom heatmaps in Session Replay Understand session replays faster with AI summaries and smart chapters Monitor ClickHouse query performance with Datadog Database Monitoring How we designed empathetic alert sounds for on-call engineers Search and act across Datadog to resolve issues faster with Bits Assistant Measure the business impact of every product change with Datadog Experiments Analyzing round trip query latency Configuring JavaScript caches for better performance Introducing Bits AI Dev Agent for Code Security Datadog achieves ISO 42001 certification for responsible AI Monitor Nutanix clusters, hosts, and VMs with Datadog Monitor Juniper Mist in Datadog A new Host Map for modern infrastructure Annotate traces to improve LLM quality with Datadog LLM Observability What’s new in Cloud SIEM: AI-powered investigations, enhanced threat intelligence, and scalable security operations Explore Kubernetes with native OpenTelemetry data Monitor Oracle Fusion Cloud Applications with Datadog Announcing the Datadog Terraform provider v4.0.0 Scaling Kubernetes workloads on custom metrics How to design cloud environments for AI-powered threat analysis
Run Synthetic tests in your CI/CD pipelines with the Data...
2022-05-05 · via Datadog | The Monitor blog

CircleCI is a CI/CD service that allows organizations to rapidly build, test, and deploy within their pipelines on a single platform. If you are using CircleCI for your CI/CD pipelines, you can now leverage the Datadog Synthetics CircleCI orb to implement Synthetic tests as part of shift-left testing. CI/CD testing is a widely adopted DevOps standard that helps teams mitigate any potential issues that could arise as a result of faulty code deployments.

Datadog Synthetic Monitoring enables you to implement a suite of end-to-end tests in your CI/CD pipelines, so you can automatically detect and block the deployment of code changes that would break key workflows or endpoints. The Datadog CircleCI orb enables you to implement these Synthetic tests in your CircleCI pipelines, surfacing issues that you can then diagnose and debug with Datadog. Adding Synthetic tests to your CircleCI pipelines will help you ensure that new code deployments are reliable, preempting any potential problems for your end users.

In this post, we’ll show you how to set up the CircleCI orb to run Synthetic tests, debug failing Synthetic tests, and monitor CircleCI pipelines together with Datadog’s existing CircleCI integration.

Set up the Datadog CircleCI orb to run Synthetic tests

A CircleCI orb is an open source, reusable config file for automating processes, expediting project startup, and easing integration between your CircleCI pipelines and services across the stack. To get started, simply add your Datadog API and application keys as environment variables to your CircleCI project. You can then start configuring the Datadog CircleCI orb to execute Datadog Synthetic tests in your pipelines.

To make sure that code deployments don’t introduce unexpected issues for your end users, you can implement a suite of Synthetic end-to-end tests to confirm that your application is functioning as expected. For example, the CircleCI pipeline configuration below utilizes the Synthetics CircleCI orb.

version: 2.1

orbs:

synthetics-ci: datadog/synthetics-ci-orb@1.0.1

jobs:

e2e-tests:

docker:

- image: cimg/base:stable

steps:

- synthetics-ci/run-tests:

public_ids: 'abc-d3f-ghi, jkl-mn0-pqr'

workflows:

run-tests:

jobs:

- e2e-tests

The above configuration will automatically trigger the Synthetic tests associated with the specified public_ids every time you deploy code changes. You can configure the orb to block the deployment if the tests fail using a config override or through the Synthetics UI. The results of your Synthetic tests will appear in your CircleCI pipeline (as shown in the example below).

View your Synthetic test executions with CircleCI

If you want to run tests on applications that are not publicly available (e.g., internal applications), you can also configure local testing by starting a local server and triggering Synthetic tests using the datadog-ci tunnel (as shown in the example below).

version: 2.1

orbs:

synthetics-ci: datadog/synthetics-ci-orb@1.0.1

jobs:

e2e-tests:

docker:

- image: your-image

steps:

- checkout

- run:

name: Running server in background

command: npm start

background: true

- synthetics-ci/run-tests:

config_path: tests/tunnel-config.json

files: tests/*.synthetics.json

test_search_query: 'tag:e2e-tests'

tunnel: true

workflows:

test-server:

jobs:

- build-image

- integration-tests:

requires:

- build-image

By virtue of the orb’s reusability, you can leverage the same unique test suite in development, staging, and production to simplify and standardize your testing across different environments. For example, you can configure your tests to automatically run in your dev environment after they’ve passed locally to ensure that new features work properly before deployment. Simply override the startURL in your global config file so that it points to your development environment.

Debug failing Synthetic tests

Datadog Synthetic Monitoring integrates with APM to offer invaluable context for troubleshooting failing tests (e.g., duration, device, and browser) alongside metrics, logs, and other data. For example, you can inspect a test’s correlated trace to learn more about why it failed. In this case, the trace shows you that the request to your API returned a 404 error. Upon further investigation, you find that this request was being transmitted to a recently deprecated client library, so you may be able to resolve this issue by switching to a different provider.

Troubleshoot failing tests with Datadog Synthetic Monitoring

Improve the reliability and efficiency of your CircleCI pipelines with Datadog

Using the Datadog CircleCI orb in conjunction with Datadog’s CircleCI integration allows you to monitor your CircleCI pipeline performance. In addition to running Synthetic tests in CircleCI, you can also use Datadog CI Visibility to optimize your pipelines. Once you’ve instrumented your CircleCI pipelines with CI Visibility, health and performance metrics will automatically stream into Datadog. You can view the results of your jobs in the CI Results Explorer and investigate problematic jobs to see where errors and bottlenecks might be occurring.

Each job contains a batch of test IDs specified by the orb. Once Datadog has run the tests, you can click on a batch of results—tagged with useful metadata, including status, branch, and duration—to pinpoint the specific test(s) that failed. As in the image below, Datadog itemizes the test results from the orb’s execution, allowing you to compare the results of individual test runs across different browsers, devices, and locations.

View job results in the CI Results Explorer

CI Visibility shows you which pipelines are the slowest or most error-prone so you can take action to improve the reliability of your tests and builds. Additionally, CI Visibility automatically detects flaky tests—another common source of failing jobs. As in the example below, you can inspect the erroneous span to get more helpful context for troubleshooting the failure.

Leverage CI visibility to troubleshoot problematic tests

Test with the CircleCI orb and monitor your pipelines with Datadog

The Datadog CircleCI orb enables you to easily incorporate Synthetic tests into your CircleCI pipelines, allowing all of your development teams to quickly detect issues before they degrade your user experience. This integration extends our existing support for Synthetic Monitoring in your CI pipelines, complementing the Datadog GitHub Action and Datadog plugin for Jenkins. CI Visibility also provides rich context around the health of your CircleCI pipelines, enabling you to optimize your CI/CD workflows. If you’re new to Datadog, sign up for a 14-day free trial.

-a