- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
Test optimization for Go is in Preview.
Test Impact Analysis is only supported on orchestrion >= 0.9.4 + dd-trace-go >= 1.70.0
.
Prior to setting up Test Impact Analysis, set up Test Optimization for Go. If you are reporting data through the Agent, use v6.40 and later or v7.40 and later.
Intelligent Test Runner Activation (intelligent_test_runner_activation_write
) 권한이 있는 조직의 사용자는 Test Service Settings 페이지에서 Intelligent Test Runner를 활성화해야 합니다.
After completing setup, run your tests by using go test
with the following code coverage options:
orchestrion go test ./... -cover -covermode=count -coverpkg ./...
-cover
: The Test Impact Analysis feature uses the built-in Go’s code coverage processor, so you need to enable code coverage collection in the go test
command.
-covermode
: must be either count
or atomic
. Because set
is not supported, setting this value disables test impact analysis.
-coverpkg
: the code coverage analysis for each test must be configured to apply in all package dependencies and not only for the package being tested. This way, if a dependency changes, you can track the test affected by this change. If you run the test command from the root of the project (where the go.mod file is), you can use the ./...
wildcard. If not, you must manually list all package dependencies comma separated (pattern1, pattern2, pattern3, ...
). For that, you could use the go list ./...
command to get all the package names.
You can override the Test Impact Analysis behavior and prevent specific tests from being skipped. These tests are referred to as unskippable tests.
Test Impact Analysis uses code coverage data to determine whether or not tests should be skipped. In some cases, this data may not be sufficient to make this determination.
Examples include:
Add the //dd:test.unskippable
comment to your test case to mark it as unskippable.
import (
"testing"
)
//dd:test.unskippable
func TestMyCustomTest(t *testing.T) {
...
}
Add the //dd:suite.unskippable
comment at the begining of the file to mark it as unskippable.
If a suite is marked as unskippable, none of the test cases from that suite can be skipped by Test Impact Analysis.
import (
"testing"
)
//dd:suite.unskippable
func TestMyCustomTest(t *testing.T) {
...
}
func TestMyCustomTest2(t *testing.T) {
...
}