Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testutil/compose: add unit tests #630

Merged
merged 5 commits into from
May 31, 2022
Merged

testutil/compose: add unit tests #630

merged 5 commits into from
May 31, 2022

Conversation

corverroos
Copy link
Contributor

Adds unit tests for different cluster configurations.

category: test
ticket: #609

// a channel on which the received webhooks will be sent.
func startAlertCollector(ctx context.Context, port int) (chan []byte, error) {
// a channel on which the received alert titles will be sent.
func startAlertCollector(ctx context.Context, port int) (chan string, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is going to be refactored away in the next sprint. Move from push Grafana alerts to pull prometheus alerts for the unit tests.

@codecov
Copy link

codecov bot commented May 30, 2022

Codecov Report

Merging #630 (464d6bd) into main (c260692) will decrease coverage by 1.44%.
The diff coverage is 30.15%.

@@            Coverage Diff             @@
##             main     #630      +/-   ##
==========================================
- Coverage   56.76%   55.32%   -1.45%     
==========================================
  Files          96       98       +2     
  Lines        9130     9430     +300     
==========================================
+ Hits         5183     5217      +34     
- Misses       3203     3468     +265     
- Partials      744      745       +1     
Impacted Files Coverage Δ
testutil/compose/compose/alert.go 0.00% <0.00%> (ø)
testutil/compose/compose/main.go 0.00% <0.00%> (ø)
testutil/compose/template.go 43.75% <ø> (ø)
testutil/compose/define.go 40.24% <66.66%> (ø)
testutil/compose/lock.go 72.91% <75.00%> (ø)
app/app.go 59.79% <100.00%> (+1.69%) ⬆️
core/sigagg/sigagg.go 58.87% <100.00%> (+1.18%) ⬆️
testutil/compose/config.go 83.33% <100.00%> (ø)
testutil/compose/new.go 75.00% <100.00%> (ø)
testutil/compose/run.go 84.21% <100.00%> (+0.21%) ⬆️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c260692...464d6bd. Read the comment docs.

//go:generate go test . -run=TestSmoke -integration -v
var integration = flag.Bool("integration", false, "Enable docker based integration test")

func TestSmoke(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the unit tests

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit tests of smoke tests 🙃

@@ -1,6 +1,6 @@
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
scrape_interval: 5s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scrape faster for more responsive alerts

Copy link
Contributor

@xenowits xenowits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM🚀

@corverroos corverroos added the merge when ready Indicates bulldozer bot may merge when all checks pass label May 31, 2022
@obol-bulldozer obol-bulldozer bot merged commit f2fa147 into main May 31, 2022
@obol-bulldozer obol-bulldozer bot deleted the corver/composealerts branch May 31, 2022 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants