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

Address incorrect aria-at harness path being updated during API updates on deployment environments #1212

Open
wants to merge 1 commit into
base: development
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
9 changes: 9 additions & 0 deletions deploy/roles/application/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@

- include: upload-source-code.yml

- name: Allow aria-bot user to run import script as admin on sandbox
lineinfile:
path: /etc/sudoers
state: present
line: 'aria-bot ALL=(ALL) NOPASSWD:{{source_dir}}/deploy/scripts/export-and-exec.sh'
validate: 'visudo -cf %s'
become: yes
when: deployment_mode == 'sandbox'

# TODO: these permissions changes are a workaround solution

- name: Make server scripts folder writable for import tests API endpoint
Expand Down
2 changes: 1 addition & 1 deletion server/controllers/TestController.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async function importTests(req, res) {
console.log(error.message);
// This is when the script fails because the git hash is invalid
// Sending semantic error.
res.sendStatus(422);
res.status(422).send(error.message);
}
}

Expand Down
11 changes: 9 additions & 2 deletions server/scripts/import-tests/testPlanVersionOperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,15 @@ const processTestPlanVersion = async ({
*/
const importHarness = () => {
const sourceFolder = path.resolve(`${testsDirectory}/resources`);
const targetFolder = path.resolve('../', 'client/resources');
console.info(`Updating harness directory, ${targetFolder} ...`);
const targetFolder = path.resolve(
__dirname,
'../../../',
'client',
'resources'
);
console.info(
`Updating harness directory, copying from ${sourceFolder} to ${targetFolder} ...`
);
fse.rmSync(targetFolder, { recursive: true, force: true });

// Copy source folder
Expand Down
1 change: 1 addition & 0 deletions server/services/TestService.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ async function runImportScript(git_hash) {
let importScriptDirectoryPrefix = isDevelopmentProcess ? '.' : './server';
let command = `${deployDirectoryPrefix}/deploy/scripts/export-and-exec.sh ${process.env.IMPORT_CONFIG} node ${importScriptDirectoryPrefix}/scripts/import-tests/index.js`;
if (git_hash) command += ` -c ${git_hash}`;
if (process.env.ENVIRONMENT === 'sandbox') command = `sudo ${command}`;
exec(command, (error, stdout, stderr) => {
if (error) {
reject(error);
Expand Down
Loading