Skip to content
Closed
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
20698e7
added test for linode_type and account_transfer
vshanthe Dec 20, 2023
5063f19
remove print statment
vshanthe Jan 3, 2024
ba4b2e1
Merge branch 'linode:dev' into dev
vshanthe Jan 10, 2024
0e18929
Merge branch 'linode:dev' into dev
vshanthe Jan 24, 2024
ba9f2ce
Merge branch 'linode:dev' into dev
vshanthe Feb 14, 2024
1269881
Merge branch 'linode:dev' into dev
vshanthe Mar 4, 2024
aa454b0
Merge branch 'linode:dev' into dev
vshanthe Mar 11, 2024
2b2f060
Merge branch 'linode:dev' into dev
vshanthe Mar 13, 2024
50da563
Merge branch 'linode:dev' into dev
vshanthe Mar 18, 2024
2823bf0
Merge branch 'linode:dev' into dev
vshanthe Mar 29, 2024
45915d2
Merge branch 'linode:dev' into dev
vshanthe Apr 12, 2024
cd1fac2
Merge branch 'linode:dev' into dev
vshanthe Apr 29, 2024
7eceff3
Merge branch 'linode:dev' into dev
vshanthe Apr 30, 2024
b91a779
Merge branch 'linode:dev' into dev
vshanthe May 2, 2024
6483c1c
Merge branch 'linode:dev' into dev
vshanthe May 3, 2024
ff1da19
Merge branch 'linode:dev' into dev
vshanthe May 7, 2024
fa1c18c
Merge branch 'linode:dev' into dev
vshanthe Jun 10, 2024
05a39c6
Merge branch 'linode:dev' into dev
vshanthe Jun 19, 2024
b4c33e9
Merge branch 'linode:dev' into dev
vshanthe Jul 11, 2024
71934ba
Merge branch 'linode:dev' into dev
vshanthe Jul 17, 2024
4e2d0c4
Merge branch 'linode:dev' into dev
vshanthe Jul 19, 2024
57e9ace
Merge branch 'linode:dev' into dev
vshanthe Jul 30, 2024
2a16f7a
Merge branch 'linode:dev' into dev
vshanthe Aug 1, 2024
c49197e
Merge branch 'linode:dev' into dev
vshanthe Aug 9, 2024
e1cf42b
Merge branch 'linode:dev' into dev
vshanthe Aug 21, 2024
6393473
Merge branch 'linode:dev' into dev
vshanthe Sep 9, 2024
b72431a
Merge branch 'linode:dev' into dev
vshanthe Sep 17, 2024
7b960c6
Merge branch 'linode:dev' into dev
vshanthe Oct 8, 2024
a91dad9
Merge branch 'linode:dev' into dev
vshanthe Oct 10, 2024
4ec9161
Merge branch 'linode:dev' into dev
vshanthe Oct 16, 2024
2910b0d
Merge branch 'linode:dev' into dev
vshanthe Oct 24, 2024
9db7fc6
url for openAPI changes
vshanthe Oct 25, 2024
b0b8305
Merge branch 'linode:dev' into dev
vshanthe Oct 25, 2024
97ec1bc
Merge remote-tracking branch 'origin/dev' into spec_changes
vshanthe Oct 25, 2024
fa87742
address pr comments
vshanthe Oct 28, 2024
8856f52
Merge branch 'linode:dev' into dev
vshanthe Oct 30, 2024
008e995
address pr comments
vshanthe Oct 30, 2024
9bd6194
Merge remote-tracking branch 'origin/dev' into spec_changes
vshanthe Oct 30, 2024
f9b190d
Merge branch 'linode:dev' into dev
vshanthe Nov 11, 2024
09686b7
fix pr comment
vshanthe Nov 11, 2024
d8da91e
resolve merge conflict
vshanthe Nov 11, 2024
120480b
Merge branch 'linode:dev' into dev
vshanthe Nov 13, 2024
9e42a6c
Merge remote-tracking branch 'origin/dev' into spec_changes
vshanthe Nov 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 47 additions & 71 deletions .github/workflows/e2e-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ on:
description: 'Use minimal test account'
required: false
default: 'false'
module:
description: "The module from 'test/integration' to the target to be tested, e.g. 'cli, domains, events, etc'"
test_path:
description: "The path from 'test/integration' to the target to be tested, e.g. 'cli'"
Copy link
Contributor

Choose a reason for hiding this comment

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

We might want to take what is in dev for this. I personally think module make things a bit more simpler

required: false
sha:
description: 'The hash value of the commit.'
required: true
required: false
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we might want to leave this as it is

default: ''
pull_request_number:
description: 'The number of the PR. Ensure sha value is provided'
required: false
openapi_spec_url:
description: 'URL of the OpenAPI spec to use for the tests'
required: false
default: ''
push:
branches:
- main
Expand All @@ -28,6 +32,15 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' && inputs.sha != '' || github.event_name == 'push' || github.event_name == 'pull_request'
steps:
- name: Validate Test Path
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you might have merged older local version of dev branch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes , raised the new PR

uses: actions-ecosystem/action-regex-match@v2
id: validate-tests
if: ${{ inputs.test_path != '' }}
with:
text: ${{ inputs.test_path }}
regex: '[^a-z0-9-:.\/_]' # Tests validation
flags: gi

- name: Checkout Repository with SHA
if: ${{ inputs.sha != '' }}
uses: actions/checkout@v4
Expand Down Expand Up @@ -82,8 +95,22 @@ jobs:
pip install certifi -U && \
pip install .[obj,dev]

- name: Download kubectl and calicoctl for LKE clusters
run: |
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
curl -LO "https://github.com/projectcalico/calico/releases/download/v3.25.0/calicoctl-linux-amd64"
chmod +x calicoctl-linux-amd64 kubectl
mv calicoctl-linux-amd64 /usr/local/bin/calicoctl
mv kubectl /usr/local/bin/kubectl

- name: Set OpenAPI Spec URL
if: ${{ inputs.openapi_spec_url != '' }}
run: |
echo "Using OpenAPI Spec URL: ${{ inputs.openapi_spec_url }}"
echo "OPENAPI_SPEC_URL=${{ inputs.openapi_spec_url }}" >> $GITHUB_ENV

- name: Install Package
run: make install
run: make install SPEC="${{ env.OPENAPI_SPEC_URL }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -95,10 +122,24 @@ jobs:
run: |
timestamp=$(date +'%Y%m%d%H%M')
report_filename="${timestamp}_cli_test_report.xml"
make testint TEST_ARGS="--junitxml=${report_filename}" MODULE="${{ inputs.module }}"
if [ -n "$OPENAPI_SPEC_URL" ]; then
echo "Running tests with OpenAPI spec from: $OPENAPI_SPEC_URL"
make testint TEST_ARGS="--junitxml=${report_filename}"
else
echo "Running tests with default OpenAPI spec"
make testint TEST_ARGS="--junitxml=${report_filename}"
fi
if: ${{ steps.validate-tests.outputs.match == '' || inputs.test_path == '' }}
env:
LINODE_CLI_TOKEN: ${{ env.LINODE_CLI_TOKEN }}

- name: Apply Calico Rules to LKE
if: always()
run: |
cd scripts && ./lke_calico_rules_e2e.sh
env:
LINODE_TOKEN: ${{ env.LINODE_CLI_TOKEN }}

- name: Upload test results
if: always()
run: |
Expand Down Expand Up @@ -143,75 +184,10 @@ jobs:
});
return result;

apply-calico-rules:
Copy link
Contributor

Choose a reason for hiding this comment

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

These jobs were recently added, let's keep these jobs as it makes the workflow easier to read

runs-on: ubuntu-latest
needs: [integration_tests]
if: ${{ success() || failure() }}

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'recursive'

- name: Set LINODE_CLI_TOKEN
run: |
echo "LINODE_CLI_TOKEN=${{ secrets[inputs.use_minimal_test_account == 'true' && 'MINIMAL_LINODE_TOKEN' || 'LINODE_TOKEN'] }}" >> $GITHUB_ENV

- name: Download kubectl and calicoctl for LKE clusters
run: |
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
curl -LO "https://github.com/projectcalico/calico/releases/download/v3.25.0/calicoctl-linux-amd64"
chmod +x calicoctl-linux-amd64 kubectl
mv calicoctl-linux-amd64 /usr/local/bin/calicoctl
mv kubectl /usr/local/bin/kubectl

- name: Apply Calico Rules to LKE
run: |
cd e2e_scripts/cloud_security_scripts/lke_calico_rules/ && ./lke_calico_rules_e2e.sh
env:
LINODE_TOKEN: ${{ env.LINODE_CLI_TOKEN }}

add-fw-to-remaining-instances:
runs-on: ubuntu-latest
needs: [integration_tests]
if: ${{ success() || failure() }}

steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install Linode CLI
run: |
pip install linode-cli

- name: Set LINODE_CLI_TOKEN
run: |
echo "LINODE_CLI_TOKEN=${{ secrets[inputs.use_minimal_test_account == 'true' && 'MINIMAL_LINODE_TOKEN' || 'LINODE_TOKEN'] }}" >> $GITHUB_ENV

- name: Create Firewall and Attach to Instances
run: |
FIREWALL_ID=$(linode-cli firewalls create --label "e2e-fw-$(date +%s)" --rules.inbound_policy "DROP" --rules.outbound_policy "ACCEPT" --text --format=id --no-headers)
echo "Created Firewall with ID: $FIREWALL_ID"

for instance_id in $(linode-cli linodes list --format "id" --text --no-header); do
echo "Attaching firewall to instance: $instance_id"
if linode-cli firewalls device-create "$FIREWALL_ID" --id "$instance_id" --type linode; then
echo "Firewall attached to instance $instance_id successfully."
else
echo "An error occurred while attaching firewall to instance $instance_id. Skipping..."
fi
done
env:
LINODE_CLI_TOKEN: ${{ env.LINODE_CLI_TOKEN }}

notify-slack:
runs-on: ubuntu-latest
needs: [integration_tests]
if: ${{ (success() || failure()) && github.repository == 'linode/linode-cli' }} # Run even if integration tests fail and only on main repository
if: always() && github.repository == 'linode/linode-cli' # Run even if integration tests fail and only on main repository

steps:
- name: Notify Slack
Expand Down