Skip to content

Commit

Permalink
Merge pull request #80 from cnescatlab/fix-test-CI
Browse files Browse the repository at this point in the history
Fixing error detection in CI
  • Loading branch information
dev31520 authored Feb 19, 2024
2 parents 93cb017 + d864e3f commit d5e3593
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,4 @@ jobs:
echo -e "Results of the CI pipeline\n" > tests_logs.txt
cd tests/
python3 -m pip install -r requirements.txt
python3 -m pytest -v |& tee -a ../tests_logs.txt
# Have the job fail if at least one test failed
- name: Check all tests passed
run: grep -v -q "FAILED" tests_logs.txt
python3 -m pytest -v
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This image is based on a LTS version of SonarQube
FROM sonarqube:9.9.3-community
FROM sonarqube:9.9.4-community

LABEL maintainer="CNES CAT Lab"

Expand Down
4 changes: 2 additions & 2 deletions tests/test_docker_cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def test_check_plugins(self):
("Kotlin Code Quality and Security","2.12.0 (build 1956)"),
("PHP Code Quality and Security","3.27.1 (build 9352)"),
("PMD", "3.4.0"),
("Python Code Quality and Security","3.24 (build 10784)"),
("Python Code Quality and Security","3.24.1 (build 11916)"),
("Ruby Code Quality and Security","1.11.0 (build 3905)"),
("Scala Code Quality and Security","1.11.0 (build 3905)"),
("ShellCheck Analyzer","2.5.0"),
Expand All @@ -381,7 +381,7 @@ def test_check_qg(self):
"""
quality_gates = requests.get(f"{self.CAT_URL}/api/qualitygates/list",
auth =("admin", "admin")).json()['qualitygates']
cnes_quality_gates = [ gate for gate in quality_gates if gate['name'] == "CNES" ]
cnes_quality_gates = [ gate for gate in quality_gates if gate['name'] == "CNES CAYCode FromScratch" ]
# Hint: if one of these tests fails, the CNES Quality Gate may not have been added correctly, check the container logs
assert cnes_quality_gates # not empty
assert cnes_quality_gates[0]['isDefault']
Expand Down

0 comments on commit d5e3593

Please sign in to comment.