diff --git a/ansible/functional-tests.yml b/ansible/functional-tests.yml index 2bcf45bfa3..35d318d125 100644 --- a/ansible/functional-tests.yml +++ b/ansible/functional-tests.yml @@ -1,5 +1,4 @@ - hosts: local - become: yes gather_facts: false vars_files: - ['{{inventory_dir}}/secrets.yml'] diff --git a/ansible/roles/functional-tests/tasks/main.yml b/ansible/roles/functional-tests/tasks/main.yml index eb02115389..112c621dfb 100644 --- a/ansible/roles/functional-tests/tasks/main.yml +++ b/ansible/roles/functional-tests/tasks/main.yml @@ -12,7 +12,9 @@ template: src: "{{ source_name }}/env_question_questionset_{{ file_version }}.json" dest: functional-tests-files/env_question_questionset_{{ file_version }}.json -- name: Trigger Functional Test +- name: Trigger Functional Test + environment: + NVM_DIR: "/var/lib/jenkins/.nvm" shell: - cmd: newman run ft_question_questionset_{{ file_version }}.json -e env_question_questionset_{{ file_version }}.json --reporters cli,htmlextra,junit --reporter-htmlextra-export newman/report.html --reporter-junit-export newman/junit_report.xml ; chown -R jenkins:jenkins newman + cmd: . /var/lib/jenkins/.nvm/nvm.sh && nvm use 16.19.0 && newman run ft_question_questionset_{{ file_version }}.json -e env_question_questionset_{{ file_version }}.json --reporters cli,htmlextra,junit --reporter-htmlextra-export newman/report.html --reporter-junit-export newman/junit_report.xml; chdir: functional-tests-files diff --git a/pipelines/functional-tests/JenkinsFile b/pipelines/functional-tests/JenkinsFile index a841bc21f3..145e14e533 100644 --- a/pipelines/functional-tests/JenkinsFile +++ b/pipelines/functional-tests/JenkinsFile @@ -25,11 +25,11 @@ node() { jobName = sh(returnStdout: true, script: "echo $JOB_NAME").split('/')[-1].trim() stage('deploy artifact'){ sh """ - rm -rf test_repo - git clone ${params.test_repo} -b ${params.test_repo_branch_or_tag} test_repo + rm -rf test_repo + git clone ${params.test_repo} -b ${params.test_repo_branch_or_tag} test_repo """ ansiblePlaybook = "${currentWs}/ansible/functional-tests.yml" - ansibleExtraArgs = "--extra-vars \" source_name=${currentWs}/test_repo/functional-tests/${params.file_version} inquiry_api_version=${params.inquiry_api_version} file_version=${params.file_version} inquiry_host_url=${params.inquiry_host_url} inquiry_channel_id=${params.inquiry_channel_id} \" --vault-password-file /var/lib/jenkins/secrets/vault-pass" + ansibleExtraArgs = "--extra-vars \" source_name=${currentWs}/test_repo/functional-tests/${params.file_version} inquiry_api_version=${params.inquiry_api_version} file_version=${params.file_version} inquiry_host_url=${params.inquiry_host_url} inquiry_channel_id=${params.inquiry_channel_id} inquiry_framework_id=${params.inquiry_framework_id} \" --vault-password-file /var/lib/jenkins/secrets/vault-pass" values.put('currentWs', currentWs) values.put('env', envDir) values.put('module', module)