Skip to content

Commit

Permalink
inherit stdio
Browse files Browse the repository at this point in the history
  • Loading branch information
eatonphil committed Jul 10, 2023
1 parent 9808cb6 commit 55d0d92
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions desktop/panel/http.test.js
Expand Up @@ -61,7 +61,9 @@ beforeAll(async () => {
// Start a new server for all tests
while (true) {
console.log('Waiting for http.server to start.');
server = spawn('python3', ['-m', 'http.server', PORT]);
server = spawn('python3', ['-m', 'http.server', PORT], {
stdio: 'inherit',
});
if (server.pid !== undefined) {
break;
}
Expand All @@ -71,7 +73,7 @@ beforeAll(async () => {

while (true) {
console.log('Waiting for httpmirror to start.');
server2 = spawn('httpmirror', [PORT2]);
server2 = spawn('httpmirror', [PORT2], { stdio: 'inherit' });
if (server2.pid !== undefined) {
break;
}
Expand All @@ -80,15 +82,7 @@ beforeAll(async () => {
}

[server, server2].forEach((s) => {
s.stdout.on('data', (data) => {
console.log(data.toString());
});

s.stderr.on('data', (data) => {
console.warn(data.toString());
});

s.on('close', function(code) {
s.on('close', function (code) {
process.stderr.write(`Server exited with ${code}.\n`);
});
});
Expand Down Expand Up @@ -124,7 +118,7 @@ for (const subprocessName of RUNNERS) {
'',
new HTTPConnectorInfo(
'',
'http://localhost:'+PORT+'/testdata/allformats/unknown'
'http://localhost:' + PORT + '/testdata/allformats/unknown'
)
);

Expand Down Expand Up @@ -161,7 +155,10 @@ for (const subprocessName of RUNNERS) {
'',
new HTTPConnectorInfo(
'',
'http://localhost:'+PORT+'/testdata/allformats/userdata.' + userdataFileType
'http://localhost:' +
PORT +
'/testdata/allformats/userdata.' +
userdataFileType
)
);

Expand Down Expand Up @@ -212,7 +209,7 @@ for (const subprocessName of RUNNERS) {
'',
new HTTPConnectorInfo(
'',
'http://localhost:'+PORT+'/testdata/logs/' + t.filename
'http://localhost:' + PORT + '/testdata/logs/' + t.filename
)
);
hp.http.http.contentTypeInfo = t.contentTypeInfo;
Expand Down Expand Up @@ -254,7 +251,7 @@ for (const subprocessName of RUNNERS) {
'',
new HTTPConnectorInfo(
'',
'http://localhost:'+PORT+'/testdata/allformats/unknown',
'http://localhost:' + PORT + '/testdata/allformats/unknown',
[{ name: 'X-Test', value: 'OK' }]
)
);
Expand Down Expand Up @@ -289,7 +286,10 @@ for (const subprocessName of RUNNERS) {
const hp = new HTTPPanelInfo(
null,
'',
new HTTPConnectorInfo('', 'http://localhost:'+PORT+'{{DM_getPanel("0")}}')
new HTTPConnectorInfo(
'',
'http://localhost:' + PORT + '{{DM_getPanel("0")}}'
)
);

const panels = [lp, hp];
Expand Down Expand Up @@ -358,7 +358,7 @@ for (const subprocessName of RUNNERS) {
'',
new HTTPConnectorInfo(
'',
'http://localhost:'+PORT+'/testdata/allformats/unknown'
'http://localhost:' + PORT + '/testdata/allformats/unknown'
)
);
hp.serverId = server.id;
Expand Down

0 comments on commit 55d0d92

Please sign in to comment.