Skip to content

chore(single-binary): Rework setup to allow adding further services

Ankit Bhatnagar requested to merge abhatnagar/rework-single-binary into main

Related #2982, &152

With the necessary pre-work around testing this already landed, this MR reworks parts of the single-binary setup to allow adding future services, e.g. ET, Snowplow, rather trivially. The intention is to move around parts of main.go into their own files with having main.go only responsible for orchestrating the pipeline.

Tested locally with:

➜  agent git:(abhatnagar/rework-single-binary) ✗ go test -v ./... -count=1
=== RUN   TestAgent
Running Suite: Agent test suite - /Users/ankitbhatnagar/go/src/gitlab.com/gitlab-org/opstrace/test/agent/tests
==============================================================================================================
Random Seed: 1729871745

Will run 6 of 6 specs
------------------------------
[BeforeSuite]
/Users/ankitbhatnagar/go/src/gitlab.com/gitlab-org/opstrace/test/agent/tests/agent_test.go:40
[BeforeSuite] PASSED [0.002 seconds]
------------------------------
Metrics Auth handling Ingest should not accept an empty jwt token
/Users/ankitbhatnagar/go/src/gitlab.com/gitlab-org/opstrace/test/agent/tests/metrics_test.go:214
• [0.008 seconds]
------------------------------
Metrics Auth handling Ingest should not accept an invalid jwt token
/Users/ankitbhatnagar/go/src/gitlab.com/gitlab-org/opstrace/test/agent/tests/metrics_test.go:219
• [0.005 seconds]
------------------------------
Metrics Auth handling Query should not accept an empty jwt token
/Users/ankitbhatnagar/go/src/gitlab.com/gitlab-org/opstrace/test/agent/tests/metrics_test.go:226
  STEP: building query for metrics names @ 10/25/24 17:55:45.889
• [0.011 seconds]
------------------------------
Metrics Auth handling Query should not accept an invalid jwt token
/Users/ankitbhatnagar/go/src/gitlab.com/gitlab-org/opstrace/test/agent/tests/metrics_test.go:234
  STEP: building query for metrics names @ 10/25/24 17:55:45.898
• [0.006 seconds]
------------------------------
Metrics Storage can use the /v1/metrics endpoint to save metrics
/Users/ankitbhatnagar/go/src/gitlab.com/gitlab-org/opstrace/test/agent/tests/metrics_test.go:245
• [0.007 seconds]
------------------------------
Metrics Storage can save metrics and retrieve names
/Users/ankitbhatnagar/go/src/gitlab.com/gitlab-org/opstrace/test/agent/tests/metrics_test.go:250
  STEP: querying for metric names @ 10/25/24 17:55:45.91
  STEP: building query for metrics names @ 10/25/24 17:55:45.91
  STEP: verifying metric details @ 10/25/24 17:55:46.949
• [1.042 seconds]
------------------------------
[AfterSuite]
/Users/ankitbhatnagar/go/src/gitlab.com/gitlab-org/opstrace/test/agent/tests/agent_test.go:59
[AfterSuite] PASSED [0.000 seconds]
------------------------------

Ran 6 of 6 Specs in 1.082 seconds
SUCCESS! -- 6 Passed | 0 Failed | 0 Pending | 0 Skipped
--- PASS: TestAgent (1.08s)
PASS
ok  	gitlab.com/gitlab-org/opstrace/test/agent/tests	2.048s
Edited by Ankit Bhatnagar

Merge request reports

Loading