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

feat: add telegram bot to lavap health #1862

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Yaroms
Copy link
Collaborator

@Yaroms Yaroms commented Dec 22, 2024

Description

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • read the contribution guide
  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the main branch
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

@Yaroms Yaroms marked this pull request as ready for review December 22, 2024 15:35
Copy link

github-actions bot commented Dec 22, 2024

Test Results

2 389 tests  +1   2 388 ✅ ±0   26m 23s ⏱️ +46s
  122 suites ±0       1 💤 +1 
    7 files   ±0       0 ❌ ±0 

Results for commit 4d9a648. ± Comparison against base commit 537c7ca.

This pull request removes 3 and adds 4 tests. Note that renamed tests count towards both.
github.com/lavanet/lava/v4/protocol/integration ‑ TestConsumerProviderWithProviders
github.com/lavanet/lava/v4/protocol/integration ‑ TestConsumerProviderWithProviders/basic-success
github.com/lavanet/lava/v4/protocol/integration ‑ TestConsumerProviderWithProviders/with_errors
github.com/lavanet/lava/v4/protocol/integration ‑ TestConsumerProviderBasicSuccess
github.com/lavanet/lava/v4/protocol/monitoring ‑ TestTelegramAlerting_Integration
github.com/lavanet/lava/v4/protocol/parser ‑ TestParseBlockFromReply/generic_parser_parse_from_array_result
github.com/lavanet/lava/v4/x/spec/keeper ‑ TestSolanaSpecAddMultipleSubscribe

♻️ This comment has been updated with latest results.

protocol/monitoring/alerting.go Show resolved Hide resolved
protocol/monitoring/health_cmd.go Outdated Show resolved Hide resolved
protocol/monitoring/health_cmd.go Show resolved Hide resolved
protocol/monitoring/alerting.go Outdated Show resolved Hide resolved
protocol/monitoring/alerting.go Outdated Show resolved Hide resolved
protocol/monitoring/telegram_alerting.go Show resolved Hide resolved
Comment on lines 39 to 55
checkRequest: func(t *testing.T, r *http.Request) {
// Check method and content type
assert.Equal(t, "POST", r.Method)
assert.Equal(t, "application/json", r.Header.Get("Content-Type"))

// Read and verify request body
body, err := io.ReadAll(r.Body)
require.NoError(t, err)

// Check if body contains expected content
bodyStr := string(body)
assert.Contains(t, bodyStr, "Test Alert")
assert.Contains(t, bodyStr, "severity")
assert.Contains(t, bodyStr, "high")
assert.Contains(t, bodyStr, "service")
assert.Contains(t, bodyStr, "test-service")
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this here and not inside the test itself?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

since not all scenatious need to check the request

protocol/monitoring/telegram_alerting_test.go Outdated Show resolved Hide resolved
shleikes
shleikes previously approved these changes Jan 13, 2025
protocol/monitoring/alerting.go Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants