Skip to content

TPT-4270: Integration tests for Linode integration with alerts#922

Merged
psnoch-akamai merged 5 commits intolinode:proj/aclp-linode-alertsfrom
psnoch-akamai:TPT-4270-linodego-qa-support-linode-integration-with-alerts
May 6, 2026
Merged

TPT-4270: Integration tests for Linode integration with alerts#922
psnoch-akamai merged 5 commits intolinode:proj/aclp-linode-alertsfrom
psnoch-akamai:TPT-4270-linodego-qa-support-linode-integration-with-alerts

Conversation

@psnoch-akamai
Copy link
Copy Markdown
Contributor

@psnoch-akamai psnoch-akamai commented Mar 25, 2026

Create tests TestLinodeAlertsWorkflow, TestTryToUpdateLinodeAlertsLegacyAndAclpAtTheSameTime and update existing tests to verify alerts fields

✔️ How to Test

make test-int TEST_ARGS="-run TestInstances_List_smoke"
make test-int TEST_ARGS="-run TestInstance_Get_smoke"
make test-int TEST_ARGS="-run TestInstance_Rebuild"
make test-int TEST_ARGS="-run TestLinodeLegacyAlertsWorkflow"
make test-int TEST_ARGS="-run TestUpdateACLPAlerts"

@psnoch-akamai psnoch-akamai requested a review from a team as a code owner March 25, 2026 13:16
@psnoch-akamai psnoch-akamai added the testing for updates to the testing suite in the changelog. label Mar 25, 2026
@psnoch-akamai psnoch-akamai requested review from ezilber-akamai and lgarber-akamai and removed request for a team March 25, 2026 13:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds/updates integration tests to validate Linode instance alert fields (legacy + ACLP-related behaviors) and introduces fixtures to record the new workflows.

Changes:

  • Add new integration workflows: TestLinodeAlertsWorkflow and TestTryToUpdateLinodeAlertsLegacyAndAclpAtTheSameTime.
  • Update existing instance integration smoke/rebuild tests to assert alert fields are present.
  • Add a getRegions helper and new recorded fixtures for the new integration tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/unit/instance_test.go Adds a placeholder unit test stub for the “legacy + ACLP alerts” update scenario.
test/integration/integration_suite_test.go Adds getRegions helper used by the new alert workflow tests.
test/integration/instances_test.go Refactors some assertions to require, adds alert-field assertions, and adds 2 new alert-focused integration tests.
test/integration/fixtures/TestInstance_TryToUpdateLinodeAlertsLegacyAndAclpAtTheSameTime.yaml New fixture covering the “cannot set both legacy and ACLP alerts” error case.
test/integration/fixtures/TestInstance_AlertsWorkflow.yaml New fixture covering create → update alerts → clone workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/integration/instances_test.go Outdated
Comment thread test/integration/instances_test.go Outdated
Comment thread test/integration/instances_test.go Outdated
Comment thread test/integration/integration_suite_test.go Outdated
Comment thread test/unit/instance_test.go Outdated
Comment thread test/integration/instances_test.go Outdated
@psnoch-akamai psnoch-akamai force-pushed the TPT-4270-linodego-qa-support-linode-integration-with-alerts branch from a3b904e to cddc607 Compare March 25, 2026 13:23
…acyAndAclpAtTheSameTime and update existing tests to verify alerts fields
@psnoch-akamai psnoch-akamai force-pushed the TPT-4270-linodego-qa-support-linode-integration-with-alerts branch from cddc607 to 97e11ef Compare March 25, 2026 14:00
@psnoch-akamai psnoch-akamai changed the title Integration tests for Linode integration with alerts TPT-4270 Integration tests for Linode integration with alerts Mar 25, 2026
@psnoch-akamai psnoch-akamai changed the title TPT-4270 Integration tests for Linode integration with alerts TPT-4270: Integration tests for Linode integration with alerts Mar 26, 2026
return result
}

func getRegions(t *testing.T, client *linodego.Client) []linodego.Region {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should still use getRegionsWithCaps() instead of creating this one. At least filter by Linodes because the alerts will be used for Linodes.

Comment thread test/integration/instances_test.go Outdated
require.Equal(t, inst.PlacementGroup.PlacementGroupPolicy, pg.PlacementGroupPolicy)
}

func TestLinodeAlertsWorkflow(t *testing.T) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This test case seems only tested the legacy alerts. Probably better to rename it and mention legacy alerts test in the name.

Comment thread test/integration/instances_test.go Outdated
require.NoError(t, err)
}

func TestTryToUpdateLinodeAlertsLegacyAndAclpAtTheSameTime(t *testing.T) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like we miss a test case for testing aclp alerts specifically. Can you add one for it?

@psnoch-akamai psnoch-akamai requested a review from a team as a code owner April 29, 2026 13:31
@psnoch-akamai psnoch-akamai requested review from mawilk90 and removed request for a team April 29, 2026 13:31
@psnoch-akamai psnoch-akamai force-pushed the TPT-4270-linodego-qa-support-linode-integration-with-alerts branch from 067899d to aec27f0 Compare April 29, 2026 15:10
Copy link
Copy Markdown
Contributor

@yec-akamai yec-akamai left a comment

Choose a reason for hiding this comment

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

New added test cases are passing. Nice work improve the old assertion style!

Can you update test instruction in the PR description? They are probably out-dated

require.NoErrorf(t, err, "Error waiting for instance created: %s", err)

rebuildOpts := linodego.InstanceRebuildOptions{
Image: "linode/alpine3.19",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not quite related to this PR but I'm seeing failures when trying to re-run this PR's fixtures since linode/alpine3.19 has been EOL'd. Any chance we could bump all occurrences of linode/alpine3.19 to linode/alpine3.23 in this file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point, let me create new ticket for this upgrade https://track.akamai.com/jira/browse/TPT-4435

Copy link
Copy Markdown
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

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

Looks great, nice work!

@psnoch-akamai psnoch-akamai merged commit 3038288 into linode:proj/aclp-linode-alerts May 6, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing for updates to the testing suite in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants