Skip to content

Commit

Permalink
CI: Notify slack channel on releases; Add test coverage for vlans and…
Browse files Browse the repository at this point in the history
… lke types (#665)

Co-authored-by: Youjung Kim <[email protected]>
  • Loading branch information
ykim-akamai and ykim-akamai authored Oct 30, 2024
1 parent 507b743 commit afdc3b2
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 10 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release-notify-slack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Notify Dev DX Channel on Release
on:
release:
types: [published]
workflow_dispatch: null

jobs:
notify:
if: github.repository == 'linode/linode-cli'
runs-on: ubuntu-latest
steps:
- name: Notify Slack - Main Message
id: main_message
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.CLI_SLACK_CHANNEL_ID }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*New Release Published: _linode-cli_ <${{ github.event.release.html_url }}|${{ github.event.release.tag_name }}> is now live!* :tada:"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
13 changes: 11 additions & 2 deletions tests/integration/linodes/test_power_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ def create_linode_in_running_state(linode_cloud_firewall):
delete_target_id("linodes", linode_id)


@pytest.fixture
def create_linode_in_running_state_for_reboot(linode_cloud_firewall):
linode_id = create_linode_and_wait(firewall_id=linode_cloud_firewall)

yield linode_id

delete_target_id("linodes", linode_id)


@pytest.mark.smoke
def test_create_linode_and_boot(test_linode_id):
linode_id = test_linode_id
Expand All @@ -36,9 +45,9 @@ def test_create_linode_and_boot(test_linode_id):
assert result, "Linode status has not changed to running from provisioning"


def test_reboot_linode(create_linode_in_running_state):
def test_reboot_linode(create_linode_in_running_state_for_reboot):
# create linode and wait until it is in "running" state
linode_id = create_linode_in_running_state
linode_id = create_linode_in_running_state_for_reboot

# reboot linode from "running" status
exec_test_command(
Expand Down
30 changes: 22 additions & 8 deletions tests/integration/lke/test_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

import pytest

from tests.integration.helpers import (
assert_headers_in_lines,
exec_test_command,
remove_lke_clusters,
)
from tests.integration.helpers import assert_headers_in_lines, exec_test_command

BASE_CMD = ["linode-cli", "lke"]

Expand Down Expand Up @@ -301,6 +297,24 @@ def test_version_view(test_version_id):

headers = ["id"]
assert_headers_in_lines(headers, lines)
# Sleep needed here for proper deletion of linodes that are related to lke cluster
time.sleep(5)
remove_lke_clusters()


def test_list_lke_types():
types = (
exec_test_command(
BASE_CMD
+ [
"types",
"--text",
]
)
.stdout.decode()
.rstrip()
)

headers = ["id", "label", "price.hourly", "price.monthly", "transfer"]
lines = types.splitlines()

assert_headers_in_lines(headers, lines)
assert "LKE Standard Availability" in types
assert "LKE High Availability" in types
62 changes: 62 additions & 0 deletions tests/integration/vlans/test_vlans.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
from tests.integration.helpers import assert_headers_in_lines, exec_test_command

BASE_CMD = ["linode-cli", "vlans"]


def test_list_vlans():
types = (
exec_test_command(
BASE_CMD
+ [
"ls",
"--text",
]
)
.stdout.decode()
.rstrip()
)

headers = ["region", "label", "linodes"]
lines = types.splitlines()

assert_headers_in_lines(headers, lines)


def test_list_vlans_help_menu():
help_menu = (
exec_test_command(
BASE_CMD
+ [
"ls",
"--h",
]
)
.stdout.decode()
.rstrip()
)

assert "linode-cli vlans ls\nList VLANs\n" in help_menu
assert (
"https://techdocs.akamai.com/linode-api/reference/get-vlans"
in help_menu
)


def test_delete_vlans_help_menu():
help_menu = (
exec_test_command(
BASE_CMD
+ [
"delete",
"--h",
]
)
.stdout.decode()
.rstrip()
)

assert "linode-cli vlans delete [LABEL] [REGIONID]" in help_menu
assert (
"https://techdocs.akamai.com/linode-api/reference/delete-vlan"
in help_menu
)

0 comments on commit afdc3b2

Please sign in to comment.