Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

See if this works #19

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
112 changes: 56 additions & 56 deletions utils/automaticTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,66 +54,66 @@ const startAutomaticTest = () => {
) &&
!testRunningFlag
) {
const terminalWriter = await startTestTerminal();

testProcess = {
process: child_process.spawn("/bin/bash"),
send: () => {
// Important to end process with ; exit\n
sendLog(
`cd ${automaticTest.folderName} && ${automaticTest.testStartCommand} ; exit\n`
);

// Locking the ability to run the test again before previous instance finishes
testRunningFlag = true;

testProcess.process.stdin.write(
`cd ${automaticTest.folderName} && ${automaticTest.testStartCommand} ; exit\n`
);
},
initEvents: () => {
// Handle Data
testProcess.process.stdout.on("data", (buffer) => {
let response = buffer.toString("utf-8");

sendLog(`startAutomaticTest - STDOUT: ${response}`);

response = response.split(/[\r\n\t]+/g);
terminalWriter.fire(
response.length > 1 ? response.join("\r\n") : response[0]
);
});

testProcess.process.stderr.on("data", (buffer) => {
let response = buffer.toString("utf-8");

startTestTerminal().then((terminalWriter) => {
testProcess = {
process: child_process.spawn("/bin/bash"),
send: () => {
// Important to end process with ; exit\n
sendLog(
`startAutomaticTest - STDERR: ${buffer.toString("utf-8")}`
);

response = response.split(/[\r\n\t]+/g);
terminalWriter.fire(
response.length > 1 ? response.join("\r\n") : response[0]
`cd ${automaticTest.folderName} && ${automaticTest.testStartCommand} ; exit\n`
);
});

// Handle Closure
testProcess.process.on("exit", (exitCode) => {
sendLog(`startAutomaticTest - exit: ${exitCode}`);
// Locking the ability to run the test again before previous instance finishes
testRunningFlag = true;

if (exitCode === 0) {
sendOutput("Test Passed.");
} else {
sendOutput("Test Failed.");
}

testRunningFlag = false;
});
},
};

testProcess.initEvents();
testProcess.send();
testProcess.process.stdin.write(
`cd ${automaticTest.folderName} && ${automaticTest.testStartCommand} ; exit\n`
);
},
initEvents: () => {
// Handle Data
testProcess.process.stdout.on("data", (buffer) => {
let response = buffer.toString("utf-8");

sendLog(`startAutomaticTest - STDOUT: ${response}`);

response = response.split(/[\r\n\t]+/g);
terminalWriter.fire(
response.length > 1 ? response.join("\r\n") : response[0]
);
});

testProcess.process.stderr.on("data", (buffer) => {
let response = buffer.toString("utf-8");

sendLog(
`startAutomaticTest - STDERR: ${buffer.toString("utf-8")}`
);

response = response.split(/[\r\n\t]+/g);
terminalWriter.fire(
response.length > 1 ? response.join("\r\n") : response[0]
);
});

// Handle Closure
testProcess.process.on("exit", (exitCode) => {
sendLog(`startAutomaticTest - exit: ${exitCode}`);

if (exitCode === 0) {
sendOutput("Test Passed.");
} else {
sendOutput("Test Failed.");
}

testRunningFlag = false;
});
},
};

testProcess.initEvents();
testProcess.send();
});
}
} catch (e) {
sendLog(`startAutomaticTest - tryCatch: ${JSON.stringify(e)}`);
Expand Down
2 changes: 1 addition & 1 deletion utils/manageTerminalSharing.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const receiveTerminalOperation = {
let manageTerminalSubscriber = null;

const manageTerminalSharing = () => {
// Start braodcasting terminal for everyone
// Start broadcasting terminal for everyone
const redirectedTerminal = vscode.window.createTerminal("Shared terminal");

redirectedTerminal.sendText(
Expand Down