Skip to content

feat (internal/civisibility): Add CIVisibility test event global hook#3531

Merged
tonyredondo merged 17 commits into
mainfrom
tony/civisibility-event-hook
May 20, 2025
Merged

feat (internal/civisibility): Add CIVisibility test event global hook#3531
tonyredondo merged 17 commits into
mainfrom
tony/civisibility-event-hook

Conversation

@tonyredondo

@tonyredondo tonyredondo commented May 19, 2025

Copy link
Copy Markdown
Member

What does this PR do?

This PR enables support for adding a hook to the test events in CI Visibility.
To enable it, we need to call the hook using a linkname because we don't want to expose it to customers yet (we are going to use internally in some repos).

Motivation

There's an internal case where a subtest should be tagged after a parent test has finished so we need to have a way to get all the tests generated by the library before closing them and send them to the backend.

Note: By setting the hook we are actively delaying all the finish() calls to the underlying span, so memory increases are expected and another reason to not make this available in the public api. If we don't set a hook we keep the same current behaviour, closing the span after the test finishes.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running golangci-lint run locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

@tonyredondo
tonyredondo force-pushed the tony/civisibility-event-hook branch from 68a876b to f2250d3 Compare May 19, 2025 08:39
@pr-commenter

pr-commenter Bot commented May 19, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2025-05-20 14:47:45

Comparing candidate commit d366a59 in PR branch tony/civisibility-event-hook with baseline commit 068fa15 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 55 metrics, 1 unstable metrics.

@tonyredondo tonyredondo changed the title Tony/civisibility event hook feat (internal/civisibility): Add CIVisibility event global hook May 19, 2025
@tonyredondo tonyredondo changed the title feat (internal/civisibility): Add CIVisibility event global hook feat (internal/civisibility): Add CIVisibility test event global hook May 19, 2025
@tonyredondo
tonyredondo marked this pull request as ready for review May 19, 2025 13:11
@tonyredondo
tonyredondo requested review from a team as code owners May 19, 2025 13:11
Comment thread internal/civisibility/integrations/manual_api_ddtest.go
Comment thread internal/civisibility/utils/codeowners.go
@tonyredondo
tonyredondo enabled auto-merge (squash) May 20, 2025 14:18
@tonyredondo
tonyredondo merged commit ce94bc2 into main May 20, 2025
@tonyredondo
tonyredondo deleted the tony/civisibility-event-hook branch May 20, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants