Skip to content

Commit 912f0eb

Browse files
BFergersonMrMineO5
andauthored
Live breakpoint test (#3)
* test: working on context receiver test * Fix gradle tasks using the npm command to work on Windows * Fix SourceMapper for Windows * Fix condition handling in LiveInstrumentRemote * Reorganize tests * breakpoint added listener * Implement applyBreakpoint in ContextReceiver.ts * Add authentication * Implement breakpoint hits * Check for side effects when evaluating conditions * fix workflow * not necessary * fix workflow * fix workflow * fix workflow * fix workflow Co-authored-by: UltraDev <petzmagnus@gmail.com>
1 parent 8f18455 commit 912f0eb

File tree

21 files changed

+440
-379
lines changed

21 files changed

+440
-379
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
jobs:
1717
build:
1818
runs-on: ubuntu-latest
19-
timeout-minutes: 10
19+
timeout-minutes: 5
2020
concurrency:
2121
group: ${{ github.workflow }}-${{ github.ref }}
2222
cancel-in-progress: true
@@ -42,18 +42,18 @@ jobs:
4242
id: properties
4343
shell: bash
4444
run: |
45-
PROPERTIES="$(./gradlew properties --console=plain -q)"
46-
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
45+
VERSION=$(grep "projectVersion" gradle.properties | cut -d'=' -f2)
4746
echo "::set-output name=version::$VERSION"
4847
echo "SPP_RELEASE_VERSION=${VERSION/-SNAPSHOT/}" >> $GITHUB_ENV
48+
SPP_RELEASE_VERSION=${VERSION/-SNAPSHOT/}
49+
echo "::set-output name=release_version::$SPP_RELEASE_VERSION"
4950
50-
- run: ./gradlew assembleUp -Dbuild.profile=release -PprobeVersion=$SPP_RELEASE_VERSION
51+
- name: Start platform
52+
run: ./gradlew assembleUp -Dbuild.profile=release -PprobeVersion=$SPP_RELEASE_VERSION
5153

5254
- name: Docker IPs
5355
run: docker inspect --format='{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)
5456

55-
- name: Set E2E_APP_HOST
56-
run: E2E_APP_HOST=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aqf "name=e2e-test")) && echo "E2E_APP_HOST=$E2E_APP_HOST" >> $GITHUB_ENV
5757
- name: Set SPP_PLATFORM_HOST
5858
run: SPP_PLATFORM_HOST=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aqf "name=spp-platform")) && echo "SPP_PLATFORM_HOST=$SPP_PLATFORM_HOST" >> $GITHUB_ENV
5959
- name: Set SPP_JWT_TOKEN
@@ -63,15 +63,10 @@ jobs:
6363
run: |
6464
until $(curl --header "Authorization: Bearer ${{ env.SPP_JWT_TOKEN }}" --insecure --output /dev/null --silent --fail http://localhost:12800/health); do printf '.'; sleep 5; done
6565
66-
- name: Wait for probe
67-
run: sleep 15s #todo: smarter waiting
68-
69-
- name: Verify probe connected
70-
run: |
71-
resp=$(curl --header "Authorization: Bearer ${{ env.SPP_JWT_TOKEN }}" --insecure http://localhost:12800/clients) && [[ $(echo $resp | jq -r ."probes"[0]."meta"."language") == "nodejs" ]] && echo $resp || (echo $resp && exit 1)
72-
7366
- name: Run tests
74-
run: npm run test
67+
run: ./gradlew test
68+
env:
69+
CI: true
7570

7671
- run: ./gradlew composeLogs
7772
if: ${{ always() }}

build.gradle.kts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
import org.apache.tools.ant.taskdefs.condition.Os
2+
13
plugins {
24
id("com.avast.gradle.docker-compose") version "0.16.8"
35
}
46

57
tasks {
8+
register<Exec>("test") {
9+
executable = getNpm()
10+
args("run", "build-test")
11+
}
612
register("cleanPackDir") {
713
file("pack/").mkdirs()
814
file("pack/").listFiles()?.forEach { it.delete() }
@@ -14,13 +20,13 @@ tasks {
1420

1521
register<Exec>("makeDist") {
1622
dependsOn("cleanPackDir")
17-
executable = "npm"
23+
executable = getNpm()
1824
args("run", "build")
1925
}
2026

2127
register<Exec>("buildDist") {
2228
dependsOn("makeDist")
23-
executable = "npm"
29+
executable = getNpm()
2430
args("pack", "--pack-destination=./pack")
2531
}
2632

@@ -37,7 +43,15 @@ tasks {
3743
}
3844

3945
dockerCompose {
40-
dockerComposeWorkingDirectory.set(File("./e2e"))
4146
removeVolumes.set(true)
4247
waitForTcpPorts.set(false)
4348
}
49+
50+
// Make npm work on Windows
51+
fun getNpm(): String {
52+
return if (Os.isFamily(Os.FAMILY_WINDOWS)) {
53+
"npm.cmd"
54+
} else {
55+
"npm"
56+
}
57+
}
Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,16 @@
11
version: '3.3'
22
services:
3-
e2e-test:
4-
container_name: e2e-test
5-
build:
6-
context: .
7-
depends_on:
8-
- spp-platform
9-
links:
10-
- spp-platform
11-
ports:
12-
- "5000:5000"
133
spp-platform:
144
image: sourceplusplus/spp-platform:latest
155
container_name: spp-platform
166
hostname: spp-platform
177
ports:
188
- "11800:11800"
19-
- "11801:11801" #todo: shouldn't be necessary
209
- "12800:12800"
10+
- "5106:5106"
2111
environment:
22-
- SPP_LOGGING_LEVEL=trace
12+
- JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5106
13+
- SPP_LOGGING_LEVEL=debug
2314
- SW_RECEIVER_GRPC_SSL_ENABLED=false #todo: fix this and config.secure = false
2415
- SPP_HTTP_SSL_ENABLED=false #todo; Change back to ssl once the library works with self-signed certs
25-
volumes:
26-
- ./config/spp-platform.crt:/skywalking/config/spp-platform.crt
27-
- ./config/spp-platform.key:/skywalking/config/spp-platform.key
16+
- SPP_GRPC_SSL_ENABLED=false

e2e/Dockerfile

Lines changed: 0 additions & 16 deletions
This file was deleted.

e2e/E2ETest.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

e2e/config/spp-platform.crt

Lines changed: 0 additions & 30 deletions
This file was deleted.

e2e/config/spp-platform.key

Lines changed: 0 additions & 51 deletions
This file was deleted.

e2e/spp-probe.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

gradle.properties

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
kotlin.code.style=official
22

33
probeGroup=plus.sourceplus.probe
4-
5-
vertxVersion=4.3.0
6-
7-
jacksonVersion=2.13.1
8-
gsonVersion = 2.8.6
9-
jupiterVersion = 5.8.0
10-
logbackVersion = 1.2.6
11-
12-
sppVersion=0.5.5-SNAPSHOT
4+
projectVersion=0.6.3-SNAPSHOT

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"scripts": {
1515
"build": "tsc",
1616
"test": "mocha test/*.js",
17+
"build-test": "npm run build && npm run test",
1718
"prepublishOnly": "npm run build"
1819
},
1920
"peerDependencies": {

0 commit comments

Comments
 (0)