Skip to content

Commit

Permalink
fix: testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed Oct 7, 2023
1 parent cac8393 commit 5b55a4d
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 86 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

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

steps:
Expand All @@ -27,4 +27,5 @@ jobs:
- run: sudo apt install python3
- run: sudo apt install php-cli
- run: npm install
- run: npm test
- run: npm run test:e2e
- run: npm run test:unit
24 changes: 24 additions & 0 deletions lib/templates/ecosystem-es.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const config = {
apps : [{
script: 'index.js',
watch: '.'
}, {
script: './service-worker/',
watch: ['./service-worker']
}],

deploy : {
production : {
user : 'SSH_USERNAME',
host : 'SSH_HOSTMACHINE',
ref : 'origin/master',
repo : 'GIT_REPOSITORY',
path : 'DESTINATION_PATH',
'pre-deploy-local': '',
'post-deploy' : 'npm install && pm2 reload ecosystem.config.js --env production',
'pre-setup': ''
}
}
};

export default config;
8 changes: 8 additions & 0 deletions lib/templates/ecosystem-simple-es.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const config = {
apps : [{
name : "app1",
script : "./app.js"
}]
}

export default config;
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
"main": "index.js",
"types": "types/index.d.ts",
"scripts": {
"test:unit": "bash test/unit.sh",
"test:e2e": "bash test/e2e.sh",
"test": "bash test/unit.sh && bash test/e2e.sh"
},
"keywords": [
Expand Down
1 change: 0 additions & 1 deletion test/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ touch e2e_time
runTest ./test/e2e/cli/reload.sh
runTest ./test/e2e/cli/start-app.sh
runTest ./test/e2e/cli/operate-regex.sh
runTest ./test/e2e/cli/interpreter.sh
runTest ./test/e2e/cli/bun.sh
runTest ./test/e2e/cli/app-configuration.sh
runTest ./test/e2e/cli/binary.sh
Expand Down
1 change: 1 addition & 0 deletions test/e2e/cli/.#interpreter.sh
4 changes: 2 additions & 2 deletions test/e2e/cli/extra-lang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cd $file_path/extra-lang

which php
spec "should php cli be installed"
which python
which python3
spec "should python cli be installed"

#
Expand Down Expand Up @@ -53,6 +53,6 @@ $pm2 delete all

$pm2 start echo.py --interpreter="/usr/bin/python3" --interpreter-args="-u" --log="cli-python.log" --merge-logs
should 'should have started 1 app' 'onl\ine' 1

sleep 1
grep "RAWPython" cli-python.log
spec "Python script should have written data in log file"
5 changes: 0 additions & 5 deletions test/e2e/cli/fork.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ should 'should start app in fork mode' 'fork_mode' 1

########### Auto Detective Interpreter In Fork mode

$pm2 kill

$pm2 start echo.coffee
should 'should has forked app' 'fork_mode' 1

### Dump resurrect should be ok
$pm2 dump

Expand Down
73 changes: 0 additions & 73 deletions test/e2e/cli/interpreter.sh

This file was deleted.

3 changes: 0 additions & 3 deletions test/e2e/cli/python-support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ source "${SRC}/../include.sh"

cd $file_path/extra-lang

which python
spec "should have python installed"

#
# Config file
#
Expand Down

0 comments on commit 5b55a4d

Please sign in to comment.