Skip to content

Commit 970e571

Browse files
authored
chore: add netcore tests to ensure vsdbg can run (#105)
1 parent 12e32d4 commit 970e571

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

Diff for: netcore/skaffold.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ profiles:
3838

3939
# integration: set of `skaffold debug`-like integration tests
4040
- name: integration
41-
# No integration tests for netcore yet
41+
deploy:
42+
kubectl:
43+
manifests:
44+
- test/k8s-test-netcore.yaml
4245

4346
# release: pushes images to production with :latest
4447
- name: release

Diff for: netcore/test/k8s-test-netcore.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# vsdbg is normally invoked via `kubectl exec` so there are no sockets
2+
# to test. This test instead executes `vsdbg`, which speaks debug
3+
# adapter protocol on stdin/stdout, and verifies that it was able to
4+
# launch with a "disconnect"
5+
apiVersion: batch/v1
6+
kind: Job
7+
metadata:
8+
name: netcore-vsdbg-runs
9+
labels:
10+
project: container-debug-support
11+
type: integration-test
12+
spec:
13+
ttlSecondsAfterFinished: 10
14+
backoffLimit: 1
15+
template:
16+
spec:
17+
restartPolicy: Never
18+
initContainers:
19+
- image: skaffold-debug-netcore
20+
name: install-netcore-support
21+
resources: {}
22+
volumeMounts:
23+
- mountPath: /dbg
24+
name: netcore-debugging-support
25+
containers:
26+
- name: netcore-vsdbg
27+
image: ubuntu
28+
args:
29+
- sh
30+
- -c
31+
- |
32+
printf 'Content-Length: 26\r\n\r\n{"command":"disconnect"}\r\n' | /dbg/netcore/vsdbg >/tmp/out
33+
if egrep -q '("success":true.*"command":"disconnect"|"command":"disconnect".*"success":true)' /tmp/out; then
34+
echo "Successfully started vsdbg"
35+
else
36+
echo "ERROR: unable to launch vsdbg"
37+
cat /tmp/out
38+
exit 1
39+
fi
40+
volumeMounts:
41+
- mountPath: /dbg
42+
name: netcore-debugging-support
43+
volumes:
44+
- emptyDir: {}
45+
name: netcore-debugging-support
46+

0 commit comments

Comments
 (0)