Skip to content

Commit 5b55a4d

Browse files
committedOct 7, 2023
fix: testing
1 parent cac8393 commit 5b55a4d

10 files changed

+40
-86
lines changed
 

‎.github/workflows/node.js.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
node-version: [14.x, 16.x, 18.x, 20.x]
16+
node-version: [20.x]
1717
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
1818

1919
steps:
@@ -27,4 +27,5 @@ jobs:
2727
- run: sudo apt install python3
2828
- run: sudo apt install php-cli
2929
- run: npm install
30-
- run: npm test
30+
- run: npm run test:e2e
31+
- run: npm run test:unit

‎lib/templates/ecosystem-es.tpl

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const config = {
2+
apps : [{
3+
script: 'index.js',
4+
watch: '.'
5+
}, {
6+
script: './service-worker/',
7+
watch: ['./service-worker']
8+
}],
9+
10+
deploy : {
11+
production : {
12+
user : 'SSH_USERNAME',
13+
host : 'SSH_HOSTMACHINE',
14+
ref : 'origin/master',
15+
repo : 'GIT_REPOSITORY',
16+
path : 'DESTINATION_PATH',
17+
'pre-deploy-local': '',
18+
'post-deploy' : 'npm install && pm2 reload ecosystem.config.js --env production',
19+
'pre-setup': ''
20+
}
21+
}
22+
};
23+
24+
export default config;

‎lib/templates/ecosystem-simple-es.tpl

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const config = {
2+
apps : [{
3+
name : "app1",
4+
script : "./app.js"
5+
}]
6+
}
7+
8+
export default config;

‎package.json

+2
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@
9999
"main": "index.js",
100100
"types": "types/index.d.ts",
101101
"scripts": {
102+
"test:unit": "bash test/unit.sh",
103+
"test:e2e": "bash test/e2e.sh",
102104
"test": "bash test/unit.sh && bash test/e2e.sh"
103105
},
104106
"keywords": [

‎test/e2e.sh

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ touch e2e_time
1515
runTest ./test/e2e/cli/reload.sh
1616
runTest ./test/e2e/cli/start-app.sh
1717
runTest ./test/e2e/cli/operate-regex.sh
18-
runTest ./test/e2e/cli/interpreter.sh
1918
runTest ./test/e2e/cli/bun.sh
2019
runTest ./test/e2e/cli/app-configuration.sh
2120
runTest ./test/e2e/cli/binary.sh

‎test/e2e/cli/.#interpreter.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
unitech@e14.7400:1696582696

‎test/e2e/cli/extra-lang.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cd $file_path/extra-lang
77

88
which php
99
spec "should php cli be installed"
10-
which python
10+
which python3
1111
spec "should python cli be installed"
1212

1313
#
@@ -53,6 +53,6 @@ $pm2 delete all
5353

5454
$pm2 start echo.py --interpreter="/usr/bin/python3" --interpreter-args="-u" --log="cli-python.log" --merge-logs
5555
should 'should have started 1 app' 'onl\ine' 1
56-
56+
sleep 1
5757
grep "RAWPython" cli-python.log
5858
spec "Python script should have written data in log file"

‎test/e2e/cli/fork.sh

-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ should 'should start app in fork mode' 'fork_mode' 1
2020

2121
########### Auto Detective Interpreter In Fork mode
2222

23-
$pm2 kill
24-
25-
$pm2 start echo.coffee
26-
should 'should has forked app' 'fork_mode' 1
27-
2823
### Dump resurrect should be ok
2924
$pm2 dump
3025

‎test/e2e/cli/interpreter.sh

-73
This file was deleted.

‎test/e2e/cli/python-support.sh

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ source "${SRC}/../include.sh"
55

66
cd $file_path/extra-lang
77

8-
which python
9-
spec "should have python installed"
10-
118
#
129
# Config file
1310
#

0 commit comments

Comments
 (0)
Please sign in to comment.