-
Notifications
You must be signed in to change notification settings - Fork 291
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
Maxim/bring heartbeats back to UI #2550
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2141de7
bring heartbeats back to UI
4c71c95
fix heartbeat rendering
15ce793
Merge branch 'dev' into maxim/bring-heartbeats-back-to-UI
6e3ce04
tune heartbeat form a bit
fea5507
add heartbeat integration test
e28e413
improve heartbeat test a bit
30c8c89
enable heartbeat test
b0925d8
Merge branch 'dev' into maxim/bring-heartbeats-back-to-UI
joeyorlando 1675544
remove heartbeat inplace intructions, update CHANGELOG
c8b3d30
Merge branch 'dev' into maxim/bring-heartbeats-back-to-UI
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
grafana-plugin/integration-tests/integrations/heartbeat.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { test, Page, expect, Locator } from '../fixtures'; | ||
|
||
import { generateRandomValue, selectDropdownValue } from '../utils/forms'; | ||
import { createIntegration } from '../utils/integrations'; | ||
|
||
test.describe("updating an integration's heartbeat interval works", async () => { | ||
test.slow(); | ||
|
||
const _openIntegrationSettingsPopup = async (page: Page): Promise<Locator> => { | ||
const integrationSettingsPopupElement = page.getByTestId('integration-settings-context-menu'); | ||
await integrationSettingsPopupElement.click(); | ||
return integrationSettingsPopupElement; | ||
}; | ||
|
||
const _openHeartbeatSettingsForm = async (page: Page) => { | ||
const integrationSettingsPopupElement = await _openIntegrationSettingsPopup(page); | ||
|
||
await integrationSettingsPopupElement.click(); | ||
|
||
await page.getByTestId('integration-heartbeat-settings').click(); | ||
}; | ||
|
||
test('"change heartbeat interval', async ({ adminRolePage: { page } }) => { | ||
const integrationName = generateRandomValue(); | ||
await createIntegration(page, integrationName); | ||
|
||
await _openHeartbeatSettingsForm(page); | ||
|
||
const heartbeatSettingsForm = page.getByTestId('heartbeat-settings-form'); | ||
|
||
const value = '30 minutes'; | ||
|
||
await selectDropdownValue({ | ||
page, | ||
startingLocator: heartbeatSettingsForm, | ||
selectType: 'grafanaSelect', | ||
value, | ||
optionExactMatch: false, | ||
}); | ||
|
||
await heartbeatSettingsForm.getByTestId('update-heartbeat').click(); | ||
|
||
await _openHeartbeatSettingsForm(page); | ||
|
||
const heartbeatIntervalValue = await heartbeatSettingsForm | ||
.locator('div[class*="grafana-select-value-container"] > div[class*="-singleValue"]') | ||
.textContent(); | ||
|
||
expect(heartbeatIntervalValue).toEqual(value); | ||
}); | ||
|
||
test('"send heartbeat', async ({ adminRolePage: { page } }) => { | ||
const integrationName = generateRandomValue(); | ||
await createIntegration(page, integrationName); | ||
|
||
await _openHeartbeatSettingsForm(page); | ||
|
||
const heartbeatSettingsForm = page.getByTestId('heartbeat-settings-form'); | ||
|
||
const endpoint = await heartbeatSettingsForm | ||
.getByTestId('input-wrapper') | ||
.locator('input[class*="input-input"]') | ||
.inputValue(); | ||
|
||
await page.goto(endpoint); | ||
|
||
await page.goBack(); | ||
|
||
const heartbeatBadge = await page.getByTestId('heartbeat-badge'); | ||
|
||
await expect(heartbeatBadge).toHaveClass(/--success/); | ||
}); | ||
}); |
8 changes: 8 additions & 0 deletions
8
...iners/IntegrationContainers/IntegrationHeartbeatForm/IntegrationHeartbeatForm.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.instruction { | ||
ol, | ||
ul { | ||
padding: 0; | ||
margin: 0; | ||
list-style: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we store
heartbeat
on the objects withinitems? why do we need
alertReceiveChannelToHeartbeat`? I believe a heartbeat always belongs to a single alert receive channel.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in my mind heartbeat is a separate entity (it even has it's own id and ideally it should have separate endpoint), that's why we have 'models/heartbeat', we need
alertReceiveChannelToHeartbeat
to save appropriate heartbeat Id for each alert receive channel, it's one to one mapping. Yes we can store heartbeat id just in alert receive channel object, but I did not want to pollute alert receive channel object