Skip to content

Commit e99d833

Browse files
Merge pull request #634 from linode/dev
v5.51.0
2 parents 0bca21c + 725bcdf commit e99d833

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1283
-400
lines changed

.github/labels.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
- name: new-feature
33
description: for new features in the changelog.
44
color: 225fee
5+
- name: project
6+
description: for new projects in the changelog.
7+
color: 46BAF0
58
- name: improvement
69
description: for improvements in existing functionality in the changelog.
710
color: 22ee47

.github/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ changelog:
33
labels:
44
- ignore-for-release
55
categories:
6-
- title: ⚠️ Breaking Change
6+
- title: 📋 New Project
7+
labels:
8+
- project
9+
- title: ⚠️ Breaking Change
710
labels:
811
- breaking-change
912
- title: 🐛 Bug Fixes
@@ -18,7 +21,7 @@ changelog:
1821
- title: 🧪 Testing Improvements
1922
labels:
2023
- testing
21-
- title: ⚙️ Repo/CI Improvements
24+
- title: ⚙️ Repo/CI Improvements
2225
labels:
2326
- repo-ci-improvement
2427
- title: 📖 Documentation

.github/workflows/e2e-suite-pr.yml renamed to .github/workflows/e2e-suite-windows.yml

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -15,99 +15,6 @@ on:
1515
name: PR E2E Tests
1616

1717
jobs:
18-
integration-fork-ubuntu:
19-
runs-on: ubuntu-latest
20-
if:
21-
github.event_name == 'workflow_dispatch' && inputs.sha != ''
22-
23-
steps:
24-
- uses: actions-ecosystem/action-regex-match@v2
25-
id: validate-tests
26-
with:
27-
text: ${{ inputs.test_path }}
28-
regex: '[^a-z0-9-:.\/_]' # Tests validation
29-
flags: gi
30-
31-
# Check out merge commit
32-
- name: Checkout PR
33-
uses: actions/checkout@v4
34-
with:
35-
ref: ${{ inputs.sha }}
36-
37-
- name: Get the hash value of the latest commit from the PR branch
38-
uses: octokit/graphql-action@v2.x
39-
id: commit-hash
40-
if: ${{ inputs.pull_request_number != '' }}
41-
with:
42-
query: |
43-
query PRHeadCommitHash($owner: String!, $repo: String!, $pr_num: Int!) {
44-
repository(owner:$owner, name:$repo) {
45-
pullRequest(number: $pr_num) {
46-
headRef {
47-
target {
48-
... on Commit {
49-
oid
50-
}
51-
}
52-
}
53-
}
54-
}
55-
}
56-
owner: ${{ github.event.repository.owner.login }}
57-
repo: ${{ github.event.repository.name }}
58-
pr_num: ${{ fromJSON(inputs.pull_request_number) }}
59-
env:
60-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61-
62-
- name: Update system packages
63-
run: sudo apt-get update -y
64-
65-
- name: Setup Python
66-
uses: actions/setup-python@v4
67-
with:
68-
python-version: '3.x'
69-
70-
- name: Install Python deps
71-
run: pip install .[dev,obj]
72-
73-
- name: Install the CLI
74-
run: make install
75-
env:
76-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77-
78-
- run: make INTEGRATION_TEST_PATH="${{ inputs.test_path }}" testint
79-
if: ${{ steps.validate-tests.outputs.match == '' }}
80-
env:
81-
LINODE_CLI_TOKEN: ${{ secrets.LINODE_TOKEN }}
82-
83-
- uses: actions/github-script@v6
84-
id: update-check-run
85-
if: ${{ inputs.pull_request_number != '' && fromJson(steps.commit-hash.outputs.data).repository.pullRequest.headRef.target.oid == inputs.sha }}
86-
env:
87-
number: ${{ inputs.pull_request_number }}
88-
job: ${{ github.job }}
89-
conclusion: ${{ job.status }}
90-
with:
91-
github-token: ${{ secrets.GITHUB_TOKEN }}
92-
script: |
93-
const { data: pull } = await github.rest.pulls.get({
94-
...context.repo,
95-
pull_number: process.env.number
96-
});
97-
const ref = pull.head.sha;
98-
const { data: checks } = await github.rest.checks.listForRef({
99-
...context.repo,
100-
ref
101-
});
102-
const check = checks.check_runs.filter(c => c.name === process.env.job);
103-
const { data: result } = await github.rest.checks.update({
104-
...context.repo,
105-
check_run_id: check[0].id,
106-
status: 'completed',
107-
conclusion: process.env.conclusion
108-
});
109-
return result;
110-
11118
integration-fork-windows:
11219
runs-on: windows-latest
11320
if:

.github/workflows/e2e-suite.yml

Lines changed: 122 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,82 @@
11
name: Integration Tests
2+
23
on:
3-
workflow_dispatch: null
4+
workflow_dispatch:
5+
inputs:
6+
use_minimal_test_account:
7+
description: 'Use minimal test account'
8+
required: false
9+
default: 'false'
10+
test_path:
11+
description: "The path from 'test/integration' to the target to be tested, e.g. 'cli'"
12+
required: false
13+
sha:
14+
description: 'The hash value of the commit.'
15+
required: false
16+
default: ''
17+
pull_request_number:
18+
description: 'The number of the PR. Ensure sha value is provided'
19+
required: false
420
push:
521
branches:
622
- main
723
- dev
24+
825
jobs:
926
integration-tests:
10-
name: Run integration tests
27+
name: Run integration tests on Ubuntu
1128
runs-on: ubuntu-latest
12-
env:
13-
EXIT_STATUS: 0
29+
if: github.event_name == 'workflow_dispatch' && inputs.sha != '' || github.event_name == 'push' || github.event_name == 'pull_request'
1430
steps:
15-
- name: Clone Repository
16-
uses: actions/checkout@v3
31+
- name: Validate Test Path
32+
uses: actions-ecosystem/action-regex-match@v2
33+
id: validate-tests
34+
if: ${{ inputs.test_path != '' }}
35+
with:
36+
text: ${{ inputs.test_path }}
37+
regex: '[^a-z0-9-:.\/_]' # Tests validation
38+
flags: gi
39+
40+
- name: Checkout Repository with SHA
41+
if: ${{ inputs.sha != '' }}
42+
uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 0
45+
submodules: 'recursive'
46+
ref: ${{ inputs.sha }}
47+
48+
- name: Checkout Repository without SHA
49+
if: ${{ inputs.sha == '' }}
50+
uses: actions/checkout@v4
1751
with:
1852
fetch-depth: 0
1953
submodules: 'recursive'
2054

55+
- name: Get the hash value of the latest commit from the PR branch
56+
uses: octokit/graphql-action@v2.x
57+
id: commit-hash
58+
if: ${{ inputs.pull_request_number != '' }}
59+
with:
60+
query: |
61+
query PRHeadCommitHash($owner: String!, $repo: String!, $pr_num: Int!) {
62+
repository(owner:$owner, name:$repo) {
63+
pullRequest(number: $pr_num) {
64+
headRef {
65+
target {
66+
... on Commit {
67+
oid
68+
}
69+
}
70+
}
71+
}
72+
}
73+
}
74+
owner: ${{ github.event.repository.owner.login }}
75+
repo: ${{ github.event.repository.name }}
76+
pr_num: ${{ fromJSON(inputs.pull_request_number) }}
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
2180
- name: Update system packages
2281
run: sudo apt-get update -y
2382

@@ -26,39 +85,85 @@ jobs:
2685
with:
2786
python-version: '3.x'
2887

29-
- name: Install Python deps
30-
run: pip install wheel boto3
31-
32-
- name: Update cert
33-
run: pip install certifi -U
88+
- name: Install Python dependencies and update cert
89+
run: |
90+
pip install wheel boto3 && \
91+
pip install certifi -U && \
92+
pip install .[obj,dev]
3493
35-
- name: Install deps
36-
run: pip install .[obj,dev]
94+
- name: Download kubectl and calicoctl for LKE clusters
95+
run: |
96+
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
97+
curl -LO "https://github.com/projectcalico/calico/releases/download/v3.25.0/calicoctl-linux-amd64"
98+
chmod +x calicoctl-linux-amd64 kubectl
99+
mv calicoctl-linux-amd64 /usr/local/bin/calicoctl
100+
mv kubectl /usr/local/bin/kubectl
37101
38102
- name: Install Package
39103
run: make install
40104
env:
41105
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42106

107+
- name: Set LINODE_CLI_TOKEN
108+
run: |
109+
echo "LINODE_CLI_TOKEN=${{ secrets[inputs.use_minimal_test_account == 'true' && 'MINIMAL_LINODE_TOKEN' || 'LINODE_TOKEN'] }}" >> $GITHUB_ENV
110+
43111
- name: Run the integration test suite
44112
run: |
45113
timestamp=$(date +'%Y%m%d%H%M')
46114
report_filename="${timestamp}_cli_test_report.xml"
47115
make testint TEST_ARGS="--junitxml=${report_filename}"
116+
if: ${{ steps.validate-tests.outputs.match == '' || inputs.test_path == '' }}
117+
env:
118+
LINODE_CLI_TOKEN: ${{ env.LINODE_CLI_TOKEN }}
119+
120+
- name: Apply Calico Rules to LKE
121+
if: always()
122+
run: |
123+
cd scripts && ./lke_calico_rules_e2e.sh
48124
env:
49-
LINODE_CLI_TOKEN: ${{ secrets.LINODE_TOKEN }}
125+
LINODE_TOKEN: ${{ env.LINODE_CLI_TOKEN }}
50126

51127
- name: Upload test results
52128
if: always()
53129
run: |
54130
filename=$(ls | grep -E '^[0-9]{12}_cli_test_report\.xml$')
55-
python tod_scripts/add_to_xml_test_report.py \
131+
python3 e2e_scripts/tod_scripts/xml_to_obj_storage/scripts/add_gha_info_to_xml.py \
56132
--branch_name "${GITHUB_REF#refs/*/}" \
57133
--gha_run_id "$GITHUB_RUN_ID" \
58134
--gha_run_number "$GITHUB_RUN_NUMBER" \
59135
--xmlfile "${filename}"
60136
sync
61-
python tod_scripts/test_report_upload_script.py "${filename}"
137+
python3 e2e_scripts/tod_scripts/xml_to_obj_storage/scripts/xml_to_obj.py "${filename}"
62138
env:
63139
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
64-
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
140+
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
141+
142+
- name: Update PR Check Run
143+
uses: actions/github-script@v6
144+
id: update-check-run
145+
if: ${{ inputs.pull_request_number != '' && fromJson(steps.commit-hash.outputs.data).repository.pullRequest.headRef.target.oid == inputs.sha }}
146+
env:
147+
number: ${{ inputs.pull_request_number }}
148+
job: ${{ github.job }}
149+
conclusion: ${{ job.status }}
150+
with:
151+
github-token: ${{ secrets.GITHUB_TOKEN }}
152+
script: |
153+
const { data: pull } = await github.rest.pulls.get({
154+
...context.repo,
155+
pull_number: process.env.number
156+
});
157+
const ref = pull.head.sha;
158+
const { data: checks } = await github.rest.checks.listForRef({
159+
...context.repo,
160+
ref
161+
});
162+
const check = checks.check_runs.filter(c => c.name === process.env.job);
163+
const { data: result } = await github.rest.checks.update({
164+
...context.repo,
165+
check_run_id: check[0].id,
166+
status: 'completed',
167+
conclusion: process.env.conclusion
168+
});
169+
return result;

.github/workflows/nightly-smoke-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
run: |
3333
make smoketest
3434
env:
35-
LINODE_CLI_TOKEN: ${{ secrets.LINODE_TOKEN_2 }}
35+
LINODE_CLI_TOKEN: ${{ secrets.LINODE_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ test/.env
1313
.tmp*
1414
MANIFEST
1515
venv
16+
openapi*.yaml

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
[submodule "test/test_helper/bats-support"]
55
path = test/test_helper/bats-support
66
url = https://github.com/ztombol/bats-support
7-
[submodule "tod_scripts"]
8-
path = tod_scripts
9-
url = https://github.com/linode/TOD-test-report-uploader.git
7+
[submodule "e2e_scripts"]
8+
path = e2e_scripts
9+
url = https://github.com/linode/dx-e2e-test-scripts

e2e_scripts

Submodule e2e_scripts added at b561785

0 commit comments

Comments
 (0)