Skip to content

Commit

Permalink
Merge pull request #14 from ykim-akamai/test/update_deprecated_images
Browse files Browse the repository at this point in the history
Test/update deprecated images
  • Loading branch information
ykim-akamai authored Jan 10, 2025
2 parents 726d607 + 2bda2cd commit a13d8c7
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 142 deletions.
82 changes: 26 additions & 56 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,64 +160,34 @@ jobs:
runs-on: ubuntu-latest
needs: [integration-tests]
if: ${{ (success() || failure()) && github.repository == 'linode/linode_api4-python' }} # Run even if integration tests fail and only on main repository

steps:
- name: Notify Slack
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:"
}
},
{
"type": "divider"
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Build Result:*\n${{ needs.integration-tests.result == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}"
},
{
"type": "mrkdwn",
"text": "*Branch:*\n`${{ github.ref_name }}`"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
},
{
"type": "mrkdwn",
"text": "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>"
}
]
},
{
"type": "divider"
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Triggered by: :bust_in_silhouette: `${{ github.actor }}`"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
blocks:
- type: section
text:
type: mrkdwn
text: ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:"
- type: divider
- type: section
fields:
- type: mrkdwn
text: "*Build Result:*\n${{ needs.integration-tests.result == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}"
- type: mrkdwn
text: "*Branch:*\n`${{ github.ref_name }}`"
- type: section
fields:
- type: mrkdwn
text: "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
- type: mrkdwn
text: "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>"
- type: divider
- type: context
elements:
- type: mrkdwn
text: "Triggered by: :bust_in_silhouette: `${{ github.actor }}`"
81 changes: 26 additions & 55 deletions .github/workflows/nightly-smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,60 +47,31 @@ jobs:
if: always() && github.repository == 'linode/linode_api4-python'
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:"
}
},
{
"type": "divider"
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Build Result:*\n${{ steps.smoke_tests.outcome == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}"
},
{
"type": "mrkdwn",
"text": "*Branch:*\n`${{ github.ref_name }}`"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
},
{
"type": "mrkdwn",
"text": "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>"
}
]
},
{
"type": "divider"
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Triggered by: :bust_in_silhouette: `${{ github.actor }}`"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
channel: ${{ secrets.SLACK_CHANNEL_ID }}
blocks:
- type: section
text:
type: mrkdwn
text: ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:"
- type: divider
- type: section
fields:
- type: mrkdwn
text: "*Build Result:*\n${{ steps.smoke_tests.outcome == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}"
- type: mrkdwn
text: "*Branch:*\n`${{ github.ref_name }}`"
- type: section
fields:
- type: mrkdwn
text: "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
- type: mrkdwn
text: "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>"
- type: divider
- type: context
elements:
- type: mrkdwn
text: "Triggered by: :bust_in_silhouette: `${{ github.actor }}`"
22 changes: 8 additions & 14 deletions .github/workflows/release-notify-slack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,12 @@ jobs:
id: main_message
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.DEV_DX_SLACK_CHANNEL_ID }}
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*New Release Published: _linode_api4-python_ <${{ github.event.release.html_url }}|${{ github.event.release.tag_name }}> is now live!* :tada:"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
channel: ${{ secrets.DEV_DX_SLACK_CHANNEL_ID }}
blocks:
- type: section
text:
type: mrkdwn
text: "*New Release Published: _linode_api4-python_ <${{ github.event.release.html_url }}|${{ github.event.release.tag_name }}> is now live!* :tada:"
2 changes: 1 addition & 1 deletion test/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def create_linode_for_pass_reset(test_linode_client, e2e_test_firewall):
linode_instance, password = client.linode.instance_create(
"g6-nanode-1",
region,
image="linode/debian10",
image="linode/debian12",
label=label,
firewall=e2e_test_firewall,
)
Expand Down
6 changes: 3 additions & 3 deletions test/integration/linode_client/test_linode_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def setup_client_and_linode(test_linode_client, e2e_test_firewall):
linode_instance, password = client.linode.instance_create(
"g6-nanode-1",
region,
image="linode/debian10",
image="linode/debian12",
label=label,
firewall=e2e_test_firewall,
)
Expand Down Expand Up @@ -250,7 +250,7 @@ def test_create_linode_instance_without_image(test_linode_client):
def test_create_linode_instance_with_image(setup_client_and_linode):
linode = setup_client_and_linode[1]

assert re.search("linode/debian10", str(linode.image))
assert re.search("linode/debian12", str(linode.image))


def test_create_linode_with_interfaces(test_linode_client):
Expand All @@ -262,7 +262,7 @@ def test_create_linode_with_interfaces(test_linode_client):
"g6-nanode-1",
region,
label=label,
image="linode/debian10",
image="linode/debian12",
interfaces=[
{"purpose": "public"},
ConfigInterface(
Expand Down
2 changes: 1 addition & 1 deletion test/integration/models/account/test_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_latest_get_event(test_linode_client, e2e_test_firewall):
linode, password = client.linode.instance_create(
"g6-nanode-1",
region,
image="linode/debian10",
image="linode/debian12",
label=label,
firewall=e2e_test_firewall,
)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/models/firewall/test_firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def linode_fw(test_linode_client):
label = get_test_label()

linode_instance, password = client.linode.instance_create(
"g6-nanode-1", region, image="linode/debian10", label=label
"g6-nanode-1", region, image="linode/debian12", label=label
)

yield linode_instance
Expand Down
14 changes: 7 additions & 7 deletions test/integration/models/linode/test_linode.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def linode_with_volume_firewall(test_linode_client):
linode_instance, password = client.linode.instance_create(
"g6-nanode-1",
region,
image="linode/debian10",
image="linode/debian12",
label=label + "_modlinode",
)

Expand Down Expand Up @@ -76,7 +76,7 @@ def linode_for_network_interface_tests(test_linode_client, e2e_test_firewall):
linode_instance, password = client.linode.instance_create(
"g6-nanode-1",
region,
image="linode/debian10",
image="linode/debian12",
label=label,
firewall=e2e_test_firewall,
)
Expand Down Expand Up @@ -147,7 +147,7 @@ def create_linode_for_long_running_tests(test_linode_client, e2e_test_firewall):
linode_instance, password = client.linode.instance_create(
"g6-nanode-1",
region,
image="linode/debian10",
image="linode/debian12",
label=label + "_long_tests",
firewall=e2e_test_firewall,
)
Expand Down Expand Up @@ -214,22 +214,22 @@ def test_linode_rebuild(test_linode_client):
label = get_test_label() + "_rebuild"

linode, password = client.linode.instance_create(
"g6-nanode-1", region, image="linode/debian10", label=label
"g6-nanode-1", region, image="linode/debian12", label=label
)

wait_for_condition(10, 100, get_status, linode, "running")

retry_sending_request(
3,
linode.rebuild,
"linode/debian10",
"linode/debian12",
disk_encryption=InstanceDiskEncryptionType.disabled,
)

wait_for_condition(10, 100, get_status, linode, "rebuilding")

assert linode.status == "rebuilding"
assert linode.image.id == "linode/debian10"
assert linode.image.id == "linode/debian12"

assert linode.disk_encryption == InstanceDiskEncryptionType.disabled

Expand Down Expand Up @@ -272,7 +272,7 @@ def test_delete_linode(test_linode_client):
linode_instance, password = client.linode.instance_create(
"g6-nanode-1",
region,
image="linode/debian10",
image="linode/debian12",
label=label + "_linode",
)

Expand Down
2 changes: 1 addition & 1 deletion test/integration/models/nodebalancer/test_nodebalancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def linode_with_private_ip(test_linode_client, e2e_test_firewall):
linode_instance, password = client.linode.instance_create(
"g6-nanode-1",
TEST_REGION,
image="linode/debian10",
image="linode/debian12",
label=label,
private_ip=True,
firewall=e2e_test_firewall,
Expand Down
2 changes: 1 addition & 1 deletion test/integration/models/volume/test_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def linode_for_volume(test_linode_client, e2e_test_firewall):
linode_instance, password = client.linode.instance_create(
"g6-nanode-1",
TEST_REGION,
image="linode/debian10",
image="linode/debian12",
label=label,
firewall=e2e_test_firewall,
)
Expand Down
4 changes: 2 additions & 2 deletions test/unit/objects/linode_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def test_create_disk(self):
1234,
label="test",
authorized_users=["test"],
image="linode/debian10",
image="linode/debian12",
)
self.assertEqual(m.call_url, "/linode/instances/123/disks")
self.assertEqual(
Expand All @@ -422,7 +422,7 @@ def test_create_disk(self):
"size": 1234,
"label": "test",
"root_pass": gen_pass,
"image": "linode/debian10",
"image": "linode/debian12",
"authorized_users": ["test"],
"read_only": False,
},
Expand Down

0 comments on commit a13d8c7

Please sign in to comment.