-
Notifications
You must be signed in to change notification settings - Fork 1.6k
173 lines (147 loc) · 5.14 KB
/
Copy pathe2e.yml
File metadata and controls
173 lines (147 loc) · 5.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: E2E Tests
on:
pull_request:
branches: [ master, v2 ]
types: [ opened, synchronize, reopened ]
push:
branches: [ master, v2 ]
permissions:
contents: read
issues: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
e2e-tests:
runs-on: ubuntu-22.04
name: E2E Tests (TLS/GnuTLS/GoTLS)
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.24.6'
- name: Install Required Tools
run: |
sudo apt-get update
sudo apt-get install --yes \
build-essential \
pkgconf \
libelf-dev \
llvm-14 \
clang-14 \
linux-tools-common \
linux-tools-generic \
gcc \
curl \
wget \
netcat-openbsd \
openssl \
libssl-dev \
ca-certificates
# Set up clang-14 as default
for tool in "clang" "llc" "llvm-strip"
do
sudo rm -f /usr/bin/$tool
sudo ln -s /usr/bin/$tool-14 /usr/bin/$tool
done
# Verify tools are installed
echo "=== Installed Tool Versions ==="
go version
clang --version | head -1
curl --version | head -1
wget --version | head -1
openssl version
- name: Prepare Linux Headers
run: |
cd /usr/src
source_file=$(find . -maxdepth 1 -name "*linux-source*.tar.bz2")
if [ -n "$source_file" ]; then
source_dir=$(echo "$source_file" | sed 's/\.tar\.bz2//g')
sudo tar -xf $source_file
cd $source_dir
test -f .config || sudo make oldconfig
fi
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: Build eCapture
run: |
make clean
make env
make -j$(nproc)
# Verify binary was built
if [ ! -f bin/ecapture ]; then
echo "❌ Failed to build ecapture binary"
exit 1
fi
ls -lh bin/ecapture
file bin/ecapture
- name: Run E2E Tests
run: |
echo "=== Running E2E Tests ==="
echo "Kernel: $(uname -r)"
echo "Architecture: $(uname -m)"
# Run comprehensive e2e tests with sudo
# Tests will connect to https://github.com to verify TLS capture
sudo make e2e || {
echo "❌ E2E tests failed"
exit 1
}
- name: E2E Test Summary
if: always()
run: |
echo "=== E2E Test Execution Complete ==="
if [ $? -eq 0 ]; then
echo "✅ All E2E tests passed successfully"
else
echo "❌ Some E2E tests failed - check logs above"
fi
e2e-tests-summary:
runs-on: ubuntu-22.04
name: E2E Test Results Summary
needs: e2e-tests
if: always()
steps:
- name: Check E2E Test Results
run: |
if [ "${{ needs.e2e-tests.result }}" == "success" ]; then
echo "✅ E2E Tests: PASSED"
exit 0
else
echo "❌ E2E Tests: FAILED"
exit 1
fi
- name: Comment PR with E2E Results
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const prNumber = context.payload.pull_request.number;
const testResult = '${{ needs.e2e-tests.result }}';
const runId = context.runId;
const statusEmoji = testResult === 'success' ? '✅' : '❌';
const statusText = testResult === 'success' ? 'PASSED' : 'FAILED';
const body = `## ${statusEmoji} E2E Test Results: ${statusText}
**Test Run:** [#${runId}](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${runId})
### Tests Executed:
- TLS/OpenSSL Module (curl → github.com)
- GnuTLS Module (wget/curl → github.com)
- GoTLS Module (Go client → github.com)
${testResult === 'success' ?
'✅ All e2e tests passed successfully! The TLS capture functionality is working correctly.' :
'❌ Some e2e tests failed. Please check the workflow logs for details.'}
---
*Automated e2e test results for commit ${context.sha.substring(0, 7)}*`;
try {
await github.rest.issues.createComment({
issue_number: prNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
});
console.log('E2E test results comment posted successfully');
} catch (error) {
console.log('Failed to post comment:', error.message);
}