elastic / elastic/elastic-agent

Create a separate go.mod for `testing/integration`

Open
#11,235 3 comments 0 reactions 0 assignees View on GitHub
Team:Elastic-Agent
Dominant language
Go
Stars
275
Forks
264
Avg merge
1d 23h
Merged PRs (30d)
312

Description

A dedicated `go.mod` for integration testing would:
- improve build times (no need to download and build a bunch of modules needed only by elastic-agent binary)
- create a clear separation between what is public API of agent vs internals

It may be necessary to place go.mod at `testing` level if there's a lot of shared code for integration tests that need to be used.

Quick start:
- run `go mod init`
- replace `github.com/elastic/elastic-agent` module with a local path pointing at the `elastic-agent` go.mod if necessary
- run `go mod tidy`
- start cutting off dependencies on `github.com/elastic/elastic-agent` packages till the module list looks sensible

Contributor guide

Open the contributing guide

Research direction

Start in testing/integration and determine whether shared integration-test code requires placing go.mod at testing instead. Run go mod init and go mod tidy, then inspect dependencies on github.com/elastic/elastic-agent and assess whether a local module replacement is needed. Done means integration tests have a separate, sensible module dependency list and still build successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system, testing
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.