-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Notify slack channel on releases; Add test coverage for vlans and…
… lke types (#665) Co-authored-by: Youjung Kim <[email protected]>
- Loading branch information
1 parent
507b743
commit afdc3b2
Showing
4 changed files
with
125 additions
and
10 deletions.
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
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 }} |
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
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,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 | ||
) |