Skip to content

Commit 58bc6f5

Browse files
authored
pm2-less integration tests (#314)
`pm2` has very confusing license. Let's try to get rid of it. Locally, seems to work fine and survive repeated executions.
1 parent 43d15bc commit 58bc6f5

File tree

3 files changed

+28
-22
lines changed

3 files changed

+28
-22
lines changed

.github/workflows/maven.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- main
1010
- postgres
1111
pull_request:
12-
branches:
12+
branches:
1313
- main
1414
- postgres
1515

@@ -27,4 +27,4 @@ jobs:
2727
java-version: 17
2828
distribution: 'temurin'
2929
- name: Build with Maven
30-
run: mvn -B clean install
30+
run: mvn -ntp -B clean install

integration-tests/pom.xml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
<properties>
1717
<sidecar.dir>../mtx/sidecar</sidecar.dir>
18+
<cds.node.executable>node</cds.node.executable>
1819
</properties>
1920

2021
<dependencies>
@@ -82,46 +83,52 @@
8283
<artifactId>cds-maven-plugin</artifactId>
8384
<version>${cds.services.version}</version>
8485
<executions>
85-
<!-- Following steps start and stop MTX sidecar for tests executed by failsafe plugin -->
8686
<execution>
87-
<id>install-sidecar</id>
87+
<id>cds.install-node</id>
8888
<goals>
89-
<goal>npm</goal>
89+
<goal>install-node</goal>
9090
</goals>
91-
<phase>pre-integration-test</phase>
9291
<configuration>
93-
<arguments>install --no-save</arguments>
94-
<skip>${skipTests}</skip>
95-
<workingDirectory>${sidecar.dir}</workingDirectory>
92+
<skip>${cdsdk-global}</skip>
9693
</configuration>
9794
</execution>
9895

9996
<execution>
100-
<id>start-sidecar</id>
97+
<id>install-sidecar</id>
10198
<goals>
102-
<goal>npx</goal>
99+
<goal>npm</goal>
103100
</goals>
104101
<phase>pre-integration-test</phase>
105102
<configuration>
106-
<arguments>pm2 -l sidecar.log --time start --name=sidecar npm -- run start</arguments>
103+
<arguments>install --no-save</arguments>
107104
<skip>${skipTests}</skip>
108105
<workingDirectory>${sidecar.dir}</workingDirectory>
109106
</configuration>
110107
</execution>
108+
</executions>
109+
</plugin>
111110

111+
<plugin>
112+
<groupId>org.codehaus.mojo</groupId>
113+
<artifactId>exec-maven-plugin</artifactId>
114+
<version>3.2.0</version>
115+
<executions>
112116
<execution>
113-
<id>stop-sidecar</id>
117+
<phase>pre-integration-test</phase>
118+
<id>start-sidecar</id>
114119
<goals>
115-
<goal>npx</goal>
120+
<goal>exec</goal>
116121
</goals>
117-
<phase>post-integration-test</phase>
118-
<configuration>
119-
<arguments>pm2 delete sidecar</arguments>
120-
<skip>${skipTests}</skip>
121-
<workingDirectory>${sidecar.dir}</workingDirectory>
122-
</configuration>
123122
</execution>
124123
</executions>
124+
<configuration>
125+
<executable>${cds.node.executable}</executable>
126+
<skip>${skipTests}</skip>
127+
<workingDirectory>${sidecar.dir}</workingDirectory>
128+
<async>true</async>
129+
<useMavenLogger>true</useMavenLogger>
130+
<commandlineArgs>node_modules/@sap/cds/bin/cds-serve.js</commandlineArgs>
131+
</configuration>
125132
</plugin>
126133
</plugins>
127134
</build>

mtx/sidecar/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
"@sap/hdi-deploy": "4.8.2"
1010
},
1111
"devDependencies": {
12-
"sqlite3": "^5",
13-
"pm2": "^5.3.0"
12+
"sqlite3": "^5"
1413
},
1514
"engines": {
1615
"node": "^18"

0 commit comments

Comments
 (0)