Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions test/stop.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,41 @@ describe('test/stop.test.js', () => {
assert(app2.stdout.includes('[app_worker] exit with code:0'));
});
});

describe('stop with symlink', () => {
const baseDir = path.join(__dirname, 'fixtures/tmp');

beforeEach(function* () {
yield fs.symlink(fixturePath, baseDir);

yield utils.cleanup(fixturePath);
yield rimraf(logDir);
yield coffee.fork(eggBin, [ 'start', '--daemon', '--workers=2' ], { cwd: baseDir })
.debug()
.expect('stdout', new RegExp(`Starting custom-framework application at ${fixturePath}`))
.expect('code', 0)
.end();

yield rimraf(baseDir);
const result = yield httpclient.request('http://127.0.0.1:7001');
assert(result.data.toString() === 'hi, egg');
});
afterEach(function* () {
yield utils.cleanup(fixturePath);
yield rimraf(baseDir);
});

it('should stop', function* () {
yield rimraf(baseDir);
yield fs.symlink(path.join(__dirname, 'fixtures/status'), baseDir);

yield coffee.fork(eggBin, [ 'stop', baseDir ])
.debug()
.expect('stdout', /\[egg-scripts] stopping egg application/)
.expect('stdout', /got master pid \["\d+\"\]/i)
.expect('code', 0)
.end();
});
});

});