Skip to content

Test Optimization only works for 1 test suite per run. #44

@SeanAlexanderHarris

Description

@SeanAlexanderHarris

When using the test-visibility-github-action with Vitest. The test steps are instrumentation simply as per the action documentation

The action only seems to work on the unit test step. The other test steps run as normal in CI, but their runs are not visible in Datadog test optimization, the additional DD_TAGS for those runs are not visible as filterable facets either increasing the likelihood they are not getting pulled in at all.

Any suggestions as to why this could be?

We have tests running in CI in this structure:

CI Pipeline Structure

┌─────────────────────────────────────────────────────────────────────────┐
│                           GitHub Actions Workflow                        │
└─────────────────────────────────────────────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────────┐
│                              Build & Test Job                           │
└─────────────────────────────────────────────────────────────────────────┘
                                    │
                    ┌───────────────┴───────────────┐
                    │                               │
                    ▼                               ▼
┌─────────────────────────────┐       ┌─────────────────────────────┐
│      Setup Environment      │       │      Install Dependencies    │
└─────────────────────────────┘       └─────────────────────────────┘
                    │                               │
                    └───────────────┬───────────────┘
                                    │
                    ┌───────────────┴───────────────┐
                    │                               │
                    ▼                               ▼
┌─────────────────────────────┐       ┌─────────────────────────────┐
│      Unit Tests             │       │      Integration Tests      │
│  ┌─────────────────────┐    │       │  ┌─────────────────────┐    │
│  │ Vitest Test Suite     │    │       │  │ API Tests          │    │
│  └─────────────────────┘    │       │  └─────────────────────┘    │
│  ┌─────────────────────┐    │       │  ┌─────────────────────┐    │
│  │ Component Tests     │    │       │  │ E2E Tests          │    │
│  └─────────────────────┘    │       │  └─────────────────────┘    │
└─────────────────────────────┘       └─────────────────────────────┘
                    │                               │
                    └───────────────┬───────────────┘
                                    │
                    ┌───────────────┴───────────────┐
                    │                               │
                    ▼                               ▼
┌─────────────────────────────┐       ┌─────────────────────────────┐
│      Build Application      │       │      Deploy Preview         │
└─────────────────────────────┘       └─────────────────────────────┘

Legend:
├─ Job
├─ Step
└─ Test Suite

Test Execution Flow

  1. Unit tests run in parallel with integration tests
  2. Build only proceeds if all tests pass
  3. Preview deployment occurs after successful build
  4. Each test suite runs in isolation to prevent interference

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions