Skip to content

Commit 69d0c0a

Browse files
committed
(test) add back custom action test suit + test path resol
1 parent a10fa8e commit 69d0c0a

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
/**
3+
* Application configuration section
4+
* http://pm2.keymetrics.io/docs/usage/application-declaration/
5+
*/
6+
apps : [
7+
{
8+
name : "test",
9+
script : "./echo.js",
10+
out_file : 'echo-out.log',
11+
error_file : 'echo-err.log',
12+
pid_file : 'echo-pid.log'
13+
}
14+
]
15+
}

test/pm2_programmatic_tests.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ mocha --opts ./mocha.opts ./lazy_api.mocha.js
4747
spec "API tests"
4848
mocha --opts ./mocha.opts ./api.backward.compatibility.mocha.js
4949
spec "API Backward compatibility tests"
50+
mocha --opts ./mocha.opts ./custom_action.mocha.js
51+
spec "Custom Actions tests"
5052

5153
mocha --opts ./mocha.opts ./logs.js
5254
spec "Logs test"

test/programmatic/path_resolution.mocha.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,30 @@ process.chdir(path.join(__dirname, '../fixtures'));
55
var PM2 = require('../..');
66
var should = require('should');
77

8-
describe('Lazy API usage', function() {
8+
describe('Path resolution in configuration file', function() {
99
before(function(done) {
1010
PM2.delete('all', function() { done() } );
1111
});
1212

13-
after(function(done) {
13+
afterEach(function(done) {
1414
PM2.delete('all', function() { done() } );
1515
});
1616

17-
it('should resolve paths', function(done) {
17+
it('should resolve paths (home)', function(done) {
1818
PM2.start('./path-resolution/ecosystem.config.js', function(err, proc) {
1919
should(proc[0].pm2_env.pm_err_log_path).eql(path.join(process.env.HOME, 'echo-err-0.log'));
2020
should(proc[0].pm2_env.pm_out_log_path).eql(path.join(process.env.HOME, 'echo-out-0.log'));
2121
should(proc[0].pm2_env.pm_pid_path).eql(path.join(process.env.HOME, 'echo-pid.log'));
2222
done();
2323
});
2424
});
25+
26+
it('should resolve paths (local)', function(done) {
27+
PM2.start('./path-resolution/ecosystem2.config.js', function(err, proc) {
28+
should(proc[0].pm2_env.pm_err_log_path).eql(path.join(process.cwd(), 'echo-err-0.log'));
29+
should(proc[0].pm2_env.pm_out_log_path).eql(path.join(process.cwd(), 'echo-out-0.log'));
30+
should(proc[0].pm2_env.pm_pid_path).eql(path.join(process.cwd(), 'echo-pid.log'));
31+
done();
32+
});
33+
});
2534
});

0 commit comments

Comments
 (0)