diff --git a/ci-scripts/Jenkinsfile-GitLab-Docker b/ci-scripts/Jenkinsfile-GitLab-Docker index 7e100fe244fed95bbf4151d5d3ad462200918450..ef04b739fffe2bd2b50c0d0d781f819672e381d7 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Docker +++ b/ci-scripts/Jenkinsfile-GitLab-Docker @@ -52,6 +52,9 @@ def dsT_host = "" def dsT_host_user = "" def dsT_host_ip_addr = "" +// dsTester tag to use +def dsTesterTag = params.DSTESTER_TAG + // Flags def scmEvent = false def upstreamEvent = false @@ -327,12 +330,14 @@ pipeline { [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.dsTesterGitLabRepository_Credentials}", usernameVariable: 'git_username', passwordVariable: 'git_token'] ]) { sh "git clone https://${git_username}:${git_token}@github.com/OPENAIRINTERFACE/chasseur.git . > ../git_clone.log 2>&1" - sh "git checkout develop >> ../git_clone.log 2>&1" - try { - sh "python3 jenkins/dogmatix-agent.py -f jenkins/suit-docker-compose.yaml | tee ../DS-TEST-RESULTS/dsTester_Summary.txt" - } catch (Exception e) { - currentBuild.result = 'FAILURE' - echo "dsTester Running FAILED" + sh "git checkout -f " + dsTesterTag + " >> ../git_clone.log 2>&1" + dir ('jenkins') { + try { + sh "python3 ./dogmatix-agent.py -f ./suits/dc/integration.yaml -d true | tee ../DS-TEST-RESULTS/dsTester_Summary.txt" + } catch (Exception e) { + currentBuild.result = 'FAILURE' + echo "dsTester Running FAILED" + } } } } diff --git a/ci-scripts/Jenkinsfile-GitLab-Helm b/ci-scripts/Jenkinsfile-GitLab-Helm index 2714b2ed90bd40ef798ee94cd77f0003673b393e..c6c0b4eb8a05dc3be0d19804156bea4d221b061c 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Helm +++ b/ci-scripts/Jenkinsfile-GitLab-Helm @@ -47,6 +47,9 @@ def dsT_host = "" def dsT_host_user = "" def dsT_host_ip_addr = "" +// dsTester tag to use +def dsTesterTag = params.DSTESTER_TAG + // Flags def scmEvent = false def upstreamEvent = false @@ -189,12 +192,14 @@ pipeline { [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.dsTesterGitLabRepository_Credentials}", usernameVariable: 'git_username', passwordVariable: 'git_token'] ]) { sh "git clone https://${git_username}:${git_token}@github.com/OPENAIRINTERFACE/chasseur.git . > ../git_clone.log 2>&1" - sh "git checkout develop >> ../git_clone.log 2>&1" - try { - sh "python3 jenkins/dogmatix-agent.py -f jenkins/suit-helm-charts.yaml | tee ../DS-TEST-RESULTS/dsTester_Summary.txt" - } catch (Exception e) { - currentBuild.result = 'FAILURE' - echo "dsTester Running FAILED" + sh "git checkout -f " + dsTesterTag + " >> ../git_clone.log 2>&1" + dir ('jenkins') { + try { + sh "python3 ./dogmatix-agent.py -f ./suits/hc/integration.yaml -d true | tee ../DS-TEST-RESULTS/dsTester_Summary.txt" + } catch (Exception e) { + currentBuild.result = 'FAILURE' + echo "dsTester Running FAILED" + } } } } diff --git a/ci-scripts/dsTestGenerateHTMLReport1.py b/ci-scripts/dsTestGenerateHTMLReport1.py index 5ffb22b9ddfe8008ba89079b0cf53d54ac1c31b4..9d342a200483e8030e20d1926f3635e3d4031be2 100644 --- a/ci-scripts/dsTestGenerateHTMLReport1.py +++ b/ci-scripts/dsTestGenerateHTMLReport1.py @@ -247,8 +247,8 @@ class HtmlReport(): self.file.write(' <h2>DS Tester Summary</h2>\n') cwd = os.getcwd() finalStatusOK = False - if os.path.isfile(cwd + '/DS-TEST-RESULTS/5gcn.yaml'): - cmd = f'egrep -c "final-result: pass" DS-TEST-RESULTS/5gcn.yaml || true' + if os.path.isfile(cwd + '/DS-TEST-RESULTS/hcintegration.yaml'): + cmd = f'egrep -c "final-result: pass" DS-TEST-RESULTS/hcintegration.yaml || true' ret = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, encoding='utf-8') if ret.stdout is not None: if ret.stdout.strip() == '1': @@ -281,8 +281,8 @@ class HtmlReport(): self.file.write(' <th>Test Details</th>\n') self.file.write(' </tr>\n') cwd = os.getcwd() - if os.path.isfile(cwd + '/DS-TEST-RESULTS/5gcn.yaml'): - with open(cwd + '/DS-TEST-RESULTS/5gcn.yaml') as f: + if os.path.isfile(cwd + '/DS-TEST-RESULTS/hcintegration.yaml'): + with open(cwd + '/DS-TEST-RESULTS/hcintegration.yaml') as f: data = yaml.load(f) nScenarios = len(data['scenarios']) for scenario in range(nScenarios): diff --git a/ci-scripts/dsTestGenerateHTMLReport2.py b/ci-scripts/dsTestGenerateHTMLReport2.py index eb18279b000a39089672fc8f50afd698e8af80f0..0e474774af5fcb687c71ddb5c1ec503b1380d56c 100644 --- a/ci-scripts/dsTestGenerateHTMLReport2.py +++ b/ci-scripts/dsTestGenerateHTMLReport2.py @@ -216,8 +216,8 @@ class HtmlReport(): self.file.write(' <h2>DS Tester Summary</h2>\n') cwd = os.getcwd() finalStatusOK = False - if os.path.isfile(cwd + '/DS-TEST-RESULTS/5gcn.yaml'): - cmd = f'egrep -c "final-result: pass" DS-TEST-RESULTS/5gcn.yaml || true' + if os.path.isfile(cwd + '/DS-TEST-RESULTS/mvc.yaml'): + cmd = f'egrep -c "final-result: pass" DS-TEST-RESULTS/mvc.yaml || true' ret = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, encoding='utf-8') if ret.stdout is not None: if ret.stdout.strip() == '1': @@ -250,8 +250,8 @@ class HtmlReport(): self.file.write(' <th>Test Details</th>\n') self.file.write(' </tr>\n') cwd = os.getcwd() - if os.path.isfile(cwd + '/DS-TEST-RESULTS/5gcn.yaml'): - with open(cwd + '/DS-TEST-RESULTS/5gcn.yaml') as f: + if os.path.isfile(cwd + '/DS-TEST-RESULTS/mvc.yaml'): + with open(cwd + '/DS-TEST-RESULTS/mvc.yaml') as f: data = yaml.load(f) nScenarios = len(data['scenarios']) for scenario in range(nScenarios): diff --git a/ci-scripts/toCheckDSTesterResult1.py b/ci-scripts/toCheckDSTesterResult1.py index 42d52ab490b1bf8ebed7791cecef5a23de82def6..8b93665434a75ec9fed41796ad56576210ae6982 100644 --- a/ci-scripts/toCheckDSTesterResult1.py +++ b/ci-scripts/toCheckDSTesterResult1.py @@ -35,6 +35,7 @@ try: result = re.search('(?:\/.+?\/)(.+?)(?:\/.+)', str(line)) if result: result1 = re.search('^(.*/)([^/]*)$', str(result.group(0))) + filename = re.search('[^/]*$', str(result1.group(0))) subprocess.check_output(f'cp {result1.group(1)}* DS-TEST-RESULTS/', stderr=subprocess.STDOUT, shell=True, universal_newlines=True) locexist = True except IOError: @@ -42,9 +43,9 @@ except IOError: if locexist: try: - with open(cwd + '/DS-TEST-RESULTS/5gcn.yaml') as f: + with open(cwd + f'/DS-TEST-RESULTS/{filename.group(0)}') as f: data = yaml.load(f) if data["final-result"] == 'fail': sys.exit('DsTester final result FAILED') except IOError: - sys.exit("File not accessible to check DSTester result: DS-TEST-RESULTS/5gcn.yaml") \ No newline at end of file + sys.exit(f'File not accessible to check DSTester result: DS-TEST-RESULTS/{filename.group(0)}')