From 0b0a929929f5f14825af28e195d6e479cc126b24 Mon Sep 17 00:00:00 2001 From: Topin2001 Date: Thu, 25 Apr 2024 16:42:39 +0200 Subject: [PATCH 1/8] Update plugin and tools --- Dockerfile | 86 +++++++++++++++------------------ pylintrc.d/pylintrc_RNC2015_A_B | 10 ++-- pylintrc.d/pylintrc_RNC2015_C | 10 ++-- pylintrc.d/pylintrc_RNC2015_D | 10 ++-- tests/README.md | 2 +- tests/requirements.txt | 34 ++++++------- 6 files changed, 73 insertions(+), 79 deletions(-) diff --git a/Dockerfile b/Dockerfile index 574da10..95d2ac7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,41 +1,44 @@ # Builder image for analysis tools -FROM debian:11-slim AS builder +FROM ubuntu:22.04 AS builder # Install tools from sources -RUN echo 'deb http://ftp.fr.debian.org/debian/ bullseye main contrib non-free' >> /etc/apt/sources.list \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - curl=7.74.0-* \ +RUN apt update \ + && apt install -y --no-install-recommends \ + curl=7.81.0-* \ # for C/C++ tools make=4.3-* \ - g\+\+=4:10.2.1-* \ - python3=3.9.2-* \ + g\+\+=4:11.2.0-* \ + python3=3.10.6-* \ libpcre3-dev=2:8.39-* \ unzip=6.0-* \ - xz-utils=5.2.5-* + xz-utils=5.2.5-* \ + && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* # sonar-scanner -RUN curl -ksSLO https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.0.2856.zip \ - && unzip sonar-scanner-cli-4.8.0.2856.zip \ - && mv /sonar-scanner-4.8.0.2856 /sonar-scanner +RUN curl -ksSLO https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006.zip \ + && unzip sonar-scanner-cli-5.0.1.3006.zip \ + && mv ./sonar-scanner-5.0.1.3006 /sonar-scanner \ + && rm sonar-scanner-cli-5.0.1.3006.zip # CppCheck -RUN curl -ksSLO https://github.com/danmar/cppcheck/archive/refs/tags/2.10.tar.gz \ - && tar -zxvf 2.10.tar.gz \ - && make -C cppcheck-2.10/ install \ +RUN curl -ksSLO https://github.com/danmar/cppcheck/archive/refs/tags/2.14.0.tar.gz \ + && tar -zxvf 2.14.0.tar.gz \ + && make -C cppcheck-2.14.0/ install \ MATCHCOMPILER="yes" \ FILESDIR="/usr/share/cppcheck" \ HAVE_RULES="yes" \ - CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function -Wno-deprecated-declarations" + CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function -Wno-deprecated-declarations" \ + && rm -rf cppcheck-2.14.0 2.14.0.tar.gz # Infer RUN curl -ksSLO https://github.com/facebook/infer/releases/download/v1.1.0/infer-linux64-v1.1.0.tar.xz \ - && tar -C /opt -Jxvf infer-linux64-v1.1.0.tar.xz + && tar -C /opt -Jxvf infer-linux64-v1.1.0.tar.xz \ + && rm infer-linux64-v1.1.0.tar.xz ################################################################################ # Final image based on the official sonar-scanner image -FROM debian:11-slim +FROM ubuntu:22.04 LABEL maintainer="CATLab" @@ -88,55 +91,46 @@ COPY --from=builder /opt/infer-linux64-v1.1.0/lib /opt/infer-linux64-v1.1.0/lib # Add CNES pylintrc A_B, C, D COPY pylintrc.d/ /opt/python/ -# Download CNES pylint extension -ADD https://github.com/cnescatlab/cnes-pylint-extension/archive/refs/tags/v6.0.0.tar.gz \ - /tmp/python/ - # Install tools -RUN echo 'deb http://ftp.fr.debian.org/debian/ bullseye main contrib non-free' >> /etc/apt/sources.list \ - && apt-get update \ +RUN apt update \ && mkdir -p /usr/share/man/man1 \ - && apt-get install -y --no-install-recommends \ + && apt install -y --no-install-recommends \ # Needed by sonar-scanner openjdk-17-jre=17.0.* \ # Needed by Pylint - python3=3.9.2-* \ - python3-pip=20.3.4-* \ + python3=3.10.6-* \ + python3-pip=22.0.2* \ # Shellcheck - shellcheck=0.7.1-* \ + shellcheck=0.8.0-* \ # Needed by Infer - libsqlite3-0=3.34.1-* \ - libtinfo5=6.2* \ + libsqlite3-0=3.37.2-* \ python2.7=2.7.18-* \ # Compilation tools needed by Infer - gcc=4:10.2.1-* \ - g\+\+=4:10.2.1-* \ - clang=1:11.0-* \ + gcc=4:11.2.0-* \ + g\+\+=4:11.2.0-* \ + clang=1:14.0-* \ make=4.3-* \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /usr/local/man \ # Install pylint and CNES pylint extension - && mkdir -p /opt/python/cnes-pylint-extension-6.0.0 \ - && tar -xvzf /tmp/python/v6.0.0.tar.gz -C /tmp/python \ - && mv /tmp/python/cnes-pylint-extension-6.0.0/checkers /opt/python/cnes-pylint-extension-6.0.0/ \ - && rm -rf /tmp/python \ && pip install --no-cache-dir \ - setuptools-scm==7.1.0 \ - pytest-runner==6.0.0 \ - wrapt==1.15.0 \ + cnes-pylint-extension==7.0.0 \ + pylint-sonarjson-catlab==2.0.0 \ + setuptools-scm==8.0.4 \ + pytest-runner==6.0.1 \ + wrapt==1.16.0 \ six==1.16.0 \ - lazy-object-proxy==1.9.0 \ + lazy-object-proxy==1.10.0 \ mccabe==0.7.0 \ - isort==5.12.0 \ - typed-ast==1.5.4 \ - astroid==2.15.2 \ - pylint==2.17.2 \ + isort==5.13.2 \ + typed-ast==1.5.5 \ + astroid==3.1.0 \ + pylint==3.1.0 \ # Infer && ln -s "/opt/infer-linux64-v1.1.0/bin/infer" /usr/local/bin/infer # Make sonar-scanner, CNES pylint and C/C++ tools executable -ENV PYTHONPATH="$PYTHONPATH:/opt/python/cnes-pylint-extension-6.0.0/checkers" \ - PATH="$SONAR_SCANNER_HOME/bin:/usr/local/bin:$PATH" \ +ENV PATH="$SONAR_SCANNER_HOME/bin:/usr/local/bin:$PATH" \ PYLINTHOME="$SONAR_SCANNER_HOME/.pylint.d" \ JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64" diff --git a/pylintrc.d/pylintrc_RNC2015_A_B b/pylintrc.d/pylintrc_RNC2015_A_B index 8734c19..c11614a 100644 --- a/pylintrc.d/pylintrc_RNC2015_A_B +++ b/pylintrc.d/pylintrc_RNC2015_A_B @@ -16,7 +16,7 @@ persistent=yes # List of plugins (as comma separated values of python modules names) to load, # usually to register additional checkers. -load-plugins=cnes_checker,pylint.extensions.check_elif,pylint_sonarjson +load-plugins=cnes_checker,pylint.extensions.check_elif,pylint_sonarjson, pylint.extensions.redefined_variable_type, pylint.extensions.comparison_placement [MESSAGES CONTROL] @@ -29,7 +29,7 @@ load-plugins=cnes_checker,pylint.extensions.check_elif,pylint_sonarjson # and R0915 (too-many-statements/COM.MET.LineOfCode) rules enabled # In addition, C0102 and W0141 have to be enabled for bad-names and bad-functions rules disable=all -enable=R5104,W0703,R5402,R5401,R5105,R0203,R0204,R5403,R5106,R0401,W0102,W9097,E0108,R5103,F0002,W9096,C0204,C0203,E0213,C0122,W9095,W0312,W0406,R5101,W0622,W0621,W0404,W0403,R5201,R5301,R5302,R5102,R0915,W0602,E0602,C0412,W0612,C0113,W0603,E0601,C0411,C0413,C0326 +enable=R5104,W0718,R5402,R5401,R5105,R0203,R0204,R5403,R5106,R0401,W0102,W9097,E0108,R5103,F0002,W9096,C0204,C0203,E0213,C2201,W9095,W0406,R5101,W0622,W0621,W0404,R5201,R5301,R5302,R5102,R0915,W0602,E0602,C0412,W0612,C0117,W0603,E0601,C0411,C0413 max-bool-expr=5 max-returns=1 @@ -293,7 +293,7 @@ int-import-graph= # Exceptions that will emit a warning when being caught. Defaults to # "Exception" -overgeneral-exceptions=Exception +overgeneral-exceptions=builtins.Exception [SONARQUBE] @@ -303,5 +303,5 @@ overgeneral-exceptions=Exception # sonar-scanner. To generate the json file, package pylint-sonarjson must be # installed. # For more information see: https://github.com/omegacen/pylint-sonarjson -sonar-rules=C0113:MINOR:10:CODE_SMELL,C0122:MINOR:10:CODE_SMELL,C0203:MINOR:10:CODE_SMELL,C0204:MINOR:10:CODE_SMELL,C0326:MINOR:10:CODE_SMELL,C0411:MINOR:10:CODE_SMELL,C0412:MINOR:10:CODE_SMELL,C0413:MINOR:10:CODE_SMELL,E0108:MINOR:10:CODE_SMELL,E0213:MAJOR:10:CODE_SMELL,E0601:MAJOR:10:CODE_SMELL,E0602:MAJOR:10:CODE_SMELL,F0002:MAJOR:10:CODE_SMELL,R0203:MINOR:10:CODE_SMELL,R0204:CRITICAL:10:CODE_SMELL,R0401:MINOR:10:CODE_SMELL,R0915:MINOR:10:CODE_SMELL,R5101:CRITICAL:10:CODE_SMELL,R5102:CRITICAL:10:CODE_SMELL,R5103:CRITICAL:10:CODE_SMELL,R5104:CRITICAL:10:CODE_SMELL,R5105:CRITICAL:10:CODE_SMELL,R5106:CRITICAL:10:CODE_SMELL,R5201:CRITICAL:10:CODE_SMELL,R5301:CRITICAL:10:CODE_SMELL,R5302:CRITICAL:10:CODE_SMELL,R5401:BLOCKER:10:CODE_SMELL,R5402:BLOCKER:10:CODE_SMELL,R5403:BLOCKER:10:CODE_SMELL,W0102:MINOR:10:CODE_SMELL,W0312:MAJOR:10:CODE_SMELL,W0403:MINOR:10:CODE_SMELL,W0404:MINOR:10:CODE_SMELL,W0406:MINOR:10:CODE_SMELL,W0602:MINOR:10:CODE_SMELL,W0603:MINOR:10:CODE_SMELL,W0612:MINOR:10:CODE_SMELL,W0621:MINOR:10:CODE_SMELL,W0622:MINOR:10:CODE_SMELL,W0703:MINOR:10:CODE_SMELL,W9095:CRITICAL:10:CODE_SMELL,W9096:CRITICAL:10:CODE_SMELL,W9097:CRITICAL:10:CODE_SMELL -output-format=json +sonar-rules=C0117:MINOR:10:CODE_SMELL,C2201:MINOR:10:CODE_SMELL,C0203:MINOR:10:CODE_SMELL,C0204:MINOR:10:CODE_SMELL,C0411:MINOR:10:CODE_SMELL,C0412:MINOR:10:CODE_SMELL,C0413:MINOR:10:CODE_SMELL,E0108:MINOR:10:CODE_SMELL,E0213:MAJOR:10:CODE_SMELL,E0601:MAJOR:10:CODE_SMELL,E0602:MAJOR:10:CODE_SMELL,F0002:MAJOR:10:CODE_SMELL,R0203:MINOR:10:CODE_SMELL,R0204:CRITICAL:10:CODE_SMELL,R0401:MINOR:10:CODE_SMELL,R0915:MINOR:10:CODE_SMELL,R5101:CRITICAL:10:CODE_SMELL,R5102:CRITICAL:10:CODE_SMELL,R5103:CRITICAL:10:CODE_SMELL,R5104:CRITICAL:10:CODE_SMELL,R5105:CRITICAL:10:CODE_SMELL,R5106:CRITICAL:10:CODE_SMELL,R5201:CRITICAL:10:CODE_SMELL,R5301:CRITICAL:10:CODE_SMELL,R5302:CRITICAL:10:CODE_SMELL,R5401:BLOCKER:10:CODE_SMELL,R5402:BLOCKER:10:CODE_SMELL,R5403:BLOCKER:10:CODE_SMELL,W0102:MINOR:10:CODE_SMELL,W0404:MINOR:10:CODE_SMELL,W0406:MINOR:10:CODE_SMELL,W0602:MINOR:10:CODE_SMELL,W0603:MINOR:10:CODE_SMELL,W0612:MINOR:10:CODE_SMELL,W0621:MINOR:10:CODE_SMELL,W0622:MINOR:10:CODE_SMELL,W0718:MINOR:10:CODE_SMELL,W9095:CRITICAL:10:CODE_SMELL,W9096:CRITICAL:10:CODE_SMELL,W9097:CRITICAL:10:CODE_SMELL +output-format=sonarjson \ No newline at end of file diff --git a/pylintrc.d/pylintrc_RNC2015_C b/pylintrc.d/pylintrc_RNC2015_C index d850bde..8ac9d52 100644 --- a/pylintrc.d/pylintrc_RNC2015_C +++ b/pylintrc.d/pylintrc_RNC2015_C @@ -16,7 +16,7 @@ persistent=yes # List of plugins (as comma separated values of python modules names) to load, # usually to register additional checkers. -load-plugins=cnes_checker,pylint.extensions.check_elif,pylint_sonarjson +load-plugins=cnes_checker,pylint.extensions.check_elif,pylint_sonarjson,pylint.extensions.redefined_variable_type,pylint.extensions.comparison_placement [MESSAGES CONTROL] @@ -29,7 +29,7 @@ load-plugins=cnes_checker,pylint.extensions.check_elif,pylint_sonarjson # and R0915 (too-many-statements/COM.MET.LineOfCode) rules enabled # In addition, C0102 and W0141 have to be enabled for bad-names and bad-functions rules disable=all -enable=R5104,W0703,R5402,R5401,R5105,R0203,R0204,R5403,R5106,R0401,W0102,W9097,E0108,R5103,F0002,W9096,C0204,C0203,E0213,C0122,W9095,W0312,W0406,R5101,W0622,W0621,W0404,W0403,R5201,R5301,R5302,R5102,R0915,W0602,E0602,C0412,W0612,C0113,W0603,E0601,C0411,C0413,C0326 +enable=R5104,W0718,R5402,R5401,R5105,R0203,R0204,R5403,R5106,R0401,W0102,W9097,E0108,R5103,F0002,W9096,C0204,C0203,E0213,C2201,W9095,W0406,R5101,W0622,W0621,W0404,R5201,R5301,R5302,R5102,R0915,W0602,E0602,C0412,W0612,C0117,W0603,E0601,C0411,C0413 max-bool-expr=5 max-returns=1 @@ -293,7 +293,7 @@ int-import-graph= # Exceptions that will emit a warning when being caught. Defaults to # "Exception" -overgeneral-exceptions=Exception +overgeneral-exceptions=builtins.Exception [SONARQUBE] @@ -303,5 +303,5 @@ overgeneral-exceptions=Exception # sonar-scanner. To generate the json file, package pylint-sonarjson must be # installed. # For more information see: https://github.com/omegacen/pylint-sonarjson -sonar-rules=C0113:MINOR:10:CODE_SMELL,C0122:MINOR:10:CODE_SMELL,C0203:MINOR:10:CODE_SMELL,C0204:MINOR:10:CODE_SMELL,C0326:MINOR:10:CODE_SMELL,C0411:MINOR:10:CODE_SMELL,C0412:MINOR:10:CODE_SMELL,C0413:MINOR:10:CODE_SMELL,E0108:MINOR:10:CODE_SMELL,E0213:MAJOR:10:CODE_SMELL,E0601:MAJOR:10:CODE_SMELL,E0602:MAJOR:10:CODE_SMELL,F0002:MAJOR:10:CODE_SMELL,R0203:MINOR:10:CODE_SMELL,R0204:CRITICAL:10:CODE_SMELL,R0401:MINOR:10:CODE_SMELL,R0915:MINOR:10:CODE_SMELL,R5101:CRITICAL:10:CODE_SMELL,R5102:CRITICAL:10:CODE_SMELL,R5103:CRITICAL:10:CODE_SMELL,R5104:CRITICAL:10:CODE_SMELL,R5105:CRITICAL:10:CODE_SMELL,R5106:CRITICAL:10:CODE_SMELL,R5201:CRITICAL:10:CODE_SMELL,R5301:CRITICAL:10:CODE_SMELL,R5302:CRITICAL:10:CODE_SMELL,R5401:BLOCKER:10:CODE_SMELL,R5402:BLOCKER:10:CODE_SMELL,R5403:BLOCKER:10:CODE_SMELL,W0102:MINOR:10:CODE_SMELL,W0312:MAJOR:10:CODE_SMELL,W0403:MINOR:10:CODE_SMELL,W0404:MINOR:10:CODE_SMELL,W0406:MINOR:10:CODE_SMELL,W0602:MINOR:10:CODE_SMELL,W0603:MINOR:10:CODE_SMELL,W0612:MINOR:10:CODE_SMELL,W0621:MINOR:10:CODE_SMELL,W0622:MINOR:10:CODE_SMELL,W0703:MINOR:10:CODE_SMELL,W9095:CRITICAL:10:CODE_SMELL,W9096:CRITICAL:10:CODE_SMELL,W9097:CRITICAL:10:CODE_SMELL -output-format=json +sonar-rules=C0117:MINOR:10:CODE_SMELL,C2201:MINOR:10:CODE_SMELL,C0203:MINOR:10:CODE_SMELL,C0204:MINOR:10:CODE_SMELL,C0411:MINOR:10:CODE_SMELL,C0412:MINOR:10:CODE_SMELL,C0413:MINOR:10:CODE_SMELL,E0108:MINOR:10:CODE_SMELL,E0213:MAJOR:10:CODE_SMELL,E0601:MAJOR:10:CODE_SMELL,E0602:MAJOR:10:CODE_SMELL,F0002:MAJOR:10:CODE_SMELL,R0203:MINOR:10:CODE_SMELL,R0204:CRITICAL:10:CODE_SMELL,R0401:MINOR:10:CODE_SMELL,R0915:MINOR:10:CODE_SMELL,R5101:CRITICAL:10:CODE_SMELL,R5102:CRITICAL:10:CODE_SMELL,R5103:CRITICAL:10:CODE_SMELL,R5104:CRITICAL:10:CODE_SMELL,R5105:CRITICAL:10:CODE_SMELL,R5106:CRITICAL:10:CODE_SMELL,R5201:CRITICAL:10:CODE_SMELL,R5301:CRITICAL:10:CODE_SMELL,R5302:CRITICAL:10:CODE_SMELL,R5401:BLOCKER:10:CODE_SMELL,R5402:BLOCKER:10:CODE_SMELL,R5403:BLOCKER:10:CODE_SMELL,W0102:MINOR:10:CODE_SMELL,W0404:MINOR:10:CODE_SMELL,W0406:MINOR:10:CODE_SMELL,W0602:MINOR:10:CODE_SMELL,W0603:MINOR:10:CODE_SMELL,W0612:MINOR:10:CODE_SMELL,W0621:MINOR:10:CODE_SMELL,W0622:MINOR:10:CODE_SMELL,W0718:MINOR:10:CODE_SMELL,W9095:CRITICAL:10:CODE_SMELL,W9096:CRITICAL:10:CODE_SMELL,W9097:CRITICAL:10:CODE_SMELL +output-format=sonarjson diff --git a/pylintrc.d/pylintrc_RNC2015_D b/pylintrc.d/pylintrc_RNC2015_D index 32bccfb..28446b7 100644 --- a/pylintrc.d/pylintrc_RNC2015_D +++ b/pylintrc.d/pylintrc_RNC2015_D @@ -16,7 +16,7 @@ persistent=yes # List of plugins (as comma separated values of python modules names) to load, # usually to register additional checkers. -load-plugins=cnes_checker,pylint.extensions.check_elif,pylint_sonarjson +load-plugins=cnes_checker,pylint.extensions.check_elif,pylint-sonarjson,pylint.extensions.redefined_variable_type,pylint.extensions.comparison_placement [MESSAGES CONTROL] @@ -29,7 +29,7 @@ load-plugins=cnes_checker,pylint.extensions.check_elif,pylint_sonarjson # and R0915 (too-many-statements/COM.MET.LineOfCode) rules enabled # In addition, C0102 and W0141 have to be enabled for bad-names and bad-functions rules disable=all -enable=R5104,W0703,R5402,R5401,R5105,R0203,R0204,R5403,R5106,R0401,W0102,W9097,E0108,R5103,F0002,W9096,C0204,C0203,E0213,C0122,W9095,W0312,W0406,R5101,W0622,W0621,W0404,W0403,R5201,R5301,R5302,R5102,R0915,W0602,E0602,C0412,W0612,C0113,W0603,E0601,C0411,C0413,C0326 +enable=R5104,W0718,R5402,R5401,R5105,R0203,R0204,R5403,R5106,R0401,W0102,W9097,E0108,R5103,F0002,W9096,C0204,C0203,E0213,C2201,W9095,W0406,R5101,W0622,W0621,W0404,R5201,R5301,R5302,R5102,R0915,W0602,E0602,C0412,W0612,C0117,W0603,E0601,C0411,C0413 max-bool-expr=5 max-returns=1 @@ -293,7 +293,7 @@ int-import-graph= # Exceptions that will emit a warning when being caught. Defaults to # "Exception" -overgeneral-exceptions=Exception +overgeneral-exceptions=builtins.Exception [SONARQUBE] @@ -303,5 +303,5 @@ overgeneral-exceptions=Exception # sonar-scanner. To generate the json file, package pylint-sonarjson must be # installed. # For more information see: https://github.com/omegacen/pylint-sonarjson -sonar-rules=C0113:MINOR:10:CODE_SMELL,C0122:MINOR:10:CODE_SMELL,C0203:MINOR:10:CODE_SMELL,C0204:MINOR:10:CODE_SMELL,C0326:MINOR:10:CODE_SMELL,C0411:MINOR:10:CODE_SMELL,C0412:MINOR:10:CODE_SMELL,C0413:MINOR:10:CODE_SMELL,E0108:MINOR:10:CODE_SMELL,E0213:MAJOR:10:CODE_SMELL,E0601:MAJOR:10:CODE_SMELL,E0602:MAJOR:10:CODE_SMELL,F0002:MAJOR:10:CODE_SMELL,R0203:MINOR:10:CODE_SMELL,R0204:CRITICAL:10:CODE_SMELL,R0401:MINOR:10:CODE_SMELL,R0915:MINOR:10:CODE_SMELL,R5101:CRITICAL:10:CODE_SMELL,R5102:CRITICAL:10:CODE_SMELL,R5103:CRITICAL:10:CODE_SMELL,R5104:CRITICAL:10:CODE_SMELL,R5105:CRITICAL:10:CODE_SMELL,R5106:CRITICAL:10:CODE_SMELL,R5201:CRITICAL:10:CODE_SMELL,R5301:CRITICAL:10:CODE_SMELL,R5302:CRITICAL:10:CODE_SMELL,R5401:BLOCKER:10:CODE_SMELL,R5402:BLOCKER:10:CODE_SMELL,R5403:BLOCKER:10:CODE_SMELL,W0102:MINOR:10:CODE_SMELL,W0312:MAJOR:10:CODE_SMELL,W0403:MINOR:10:CODE_SMELL,W0404:MINOR:10:CODE_SMELL,W0406:MINOR:10:CODE_SMELL,W0602:MINOR:10:CODE_SMELL,W0603:MINOR:10:CODE_SMELL,W0612:MINOR:10:CODE_SMELL,W0621:MINOR:10:CODE_SMELL,W0622:MINOR:10:CODE_SMELL,W0703:MINOR:10:CODE_SMELL,W9095:CRITICAL:10:CODE_SMELL,W9096:CRITICAL:10:CODE_SMELL,W9097:CRITICAL:10:CODE_SMELL -output-format=json +sonar-rules=C0117:MINOR:10:CODE_SMELL,C2201:MINOR:10:CODE_SMELL,C0203:MINOR:10:CODE_SMELL,C0204:MINOR:10:CODE_SMELL,C0411:MINOR:10:CODE_SMELL,C0412:MINOR:10:CODE_SMELL,C0413:MINOR:10:CODE_SMELL,E0108:MINOR:10:CODE_SMELL,E0213:MAJOR:10:CODE_SMELL,E0601:MAJOR:10:CODE_SMELL,E0602:MAJOR:10:CODE_SMELL,F0002:MAJOR:10:CODE_SMELL,R0203:MINOR:10:CODE_SMELL,R0204:CRITICAL:10:CODE_SMELL,R0401:MINOR:10:CODE_SMELL,R0915:MINOR:10:CODE_SMELL,R5101:CRITICAL:10:CODE_SMELL,R5102:CRITICAL:10:CODE_SMELL,R5103:CRITICAL:10:CODE_SMELL,R5104:CRITICAL:10:CODE_SMELL,R5105:CRITICAL:10:CODE_SMELL,R5106:CRITICAL:10:CODE_SMELL,R5201:CRITICAL:10:CODE_SMELL,R5301:CRITICAL:10:CODE_SMELL,R5302:CRITICAL:10:CODE_SMELL,R5401:BLOCKER:10:CODE_SMELL,R5402:BLOCKER:10:CODE_SMELL,R5403:BLOCKER:10:CODE_SMELL,W0102:MINOR:10:CODE_SMELL,W0404:MINOR:10:CODE_SMELL,W0406:MINOR:10:CODE_SMELL,W0602:MINOR:10:CODE_SMELL,W0603:MINOR:10:CODE_SMELL,W0612:MINOR:10:CODE_SMELL,W0621:MINOR:10:CODE_SMELL,W0622:MINOR:10:CODE_SMELL,W0718:MINOR:10:CODE_SMELL,W9095:CRITICAL:10:CODE_SMELL,W9096:CRITICAL:10:CODE_SMELL,W9097:CRITICAL:10:CODE_SMELL +output-format=sonarjson diff --git a/tests/README.md b/tests/README.md index 17c399e..4fd1908 100644 --- a/tests/README.md +++ b/tests/README.md @@ -72,7 +72,7 @@ $ pip install -r requirements.txt -p 9000:9000 \ -e SONARQUBE_ADMIN_PASSWORD=adminpassword \ --net sonarbridge \ - lequal/sonarqube:latest + lequal/sonarqube-catlab:latest ``` - Wait until it is configured diff --git a/tests/requirements.txt b/tests/requirements.txt index 1cb8d61..501ded2 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,17 +1,17 @@ -attrs==20.2.0 -certifi==2020.6.20 -chardet==3.0.4 -docker==4.3.1 -idna==2.10 -iniconfig==1.0.1 -more-itertools==8.5.0 -packaging==20.4 -pluggy==0.13.1 -py==1.9.0 -pyparsing==2.4.7 -pytest==6.0.2 -requests==2.24.0 -six==1.15.0 -toml==0.10.1 -urllib3==1.25.10 -websocket-client==0.57.0 +attrs==23.2.0 +certifi==2024.2.2 +chardet==5.2.0 +docker==7.0.0 +idna==3.7 +iniconfig==2.0.0 +more-itertools==10.2.0 +packaging==24.0 +pluggy==1.5.0 +py==1.11.0 +pyparsing==3.1.2 +pytest==8.1.1 +requests==2.31.0 +six==1.16.0 +toml==0.10.2 +urllib3==2.2.1 +websocket-client==1.8.0 From 04dc46d29600bc14abe7b4a648b8a75b00ba0e86 Mon Sep 17 00:00:00 2001 From: Topin2001 Date: Thu, 2 May 2024 11:20:22 +0200 Subject: [PATCH 2/8] Update readme according to tools version --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index baa23d4..e8a5247 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ -# CNES sonar-scanner image \[client\] +# CNES sonar-scanner image ![](https://github.com/cnescatlab/sonar-scanner/workflows/CI/badge.svg) ![](https://github.com/cnescatlab/sonar-scanner/workflows/CD/badge.svg) -[![Codacy Badge](https://app.codacy.com/project/badge/Grade/f5f71dea84ce4020ab15a99fc841a696)](https://www.codacy.com/gh/cnescatlab/sonar-scanner?utm_source=github.com&utm_medium=referral&utm_content=lequal/sonar-scanner&utm_campaign=Badge_Grade) > Docker environment containing open source code analysis tools configured by CNES and dedicated to Continuous Integration. @@ -236,11 +235,11 @@ sonar-scanning: | Tool | Version | Default report file | | ------------------------------------------------------------------------------ | ---------- | ------------------- | -| [sonar-scanner](https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/) | 4.8.0.2856 | | -| [ShellCheck](https://github.com/koalaman/shellcheck) | 0.7.1 | | -| [pylint](http://pylint.pycqa.org/en/latest/user_guide/index.html) | 2.17.2 | pylint-report.txt | -| [CNES pylint extension](https://github.com/cnescatlab/cnes-pylint-extension) | 6.0.0 | | -| [CppCheck](https://github.com/danmar/cppcheck) | 2.10 | cppcheck-report.xml | +| [sonar-scanner](https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/) | 5.0.1.3006 | | +| [ShellCheck](https://github.com/koalaman/shellcheck) | 0.8.0 | | +| [pylint](http://pylint.pycqa.org/en/latest/user_guide/index.html) | 3.1.0 | pylint-report.txt | +| [CNES pylint extension](https://github.com/cnescatlab/cnes-pylint-extension) | 7.0.0 | | +| [CppCheck](https://github.com/danmar/cppcheck) | 2.14.0 | cppcheck-report.xml | | [Infer](https://fbinfer.com/) | 1.1.0 | | ## Developer's guide From bd66567ef0b09b42942b2e1d95940c8ebe38588e Mon Sep 17 00:00:00 2001 From: Topin2001 Date: Thu, 2 May 2024 14:31:32 +0200 Subject: [PATCH 3/8] change CD repo name --- .github/workflows/cd.yml | 64 ++++++++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 38ea1a6..35074ab 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -24,13 +24,13 @@ on: env: DOCKERFILE_PATH: "." DOCKERFILE_FILENAME: "Dockerfile" - DOCKER_IMAGE_NAME: "lequal/sonar-scanner" + DOCKER_IMAGE_NAME: "lequal/sonar-scanner-catlab" jobs: # Job to test if a new version is ready to be released deliverability: name: Check if a new version must be released - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 # The job is run only if the CI workflow succeeded if: github.event.workflow_run.conclusion == 'success' outputs: @@ -48,7 +48,7 @@ jobs: if [ "$milestones" == "[]" ] then echo No milestone completed, not delivering - echo "::set-output name=delivery::forbidden" + echo "delivery=forbidden" >> $GITHUB_OUTPUT exit 0 fi echo -e "Completed milestones:\n$milestones" @@ -62,17 +62,18 @@ jobs: exit 1 fi echo Ready to deliver - echo "::set-output name=version::$version" - echo "::set-output name=milestone_number::$milestone_number" - echo "::set-output name=delivery::allowed" + echo "version=$version" >> $GITHUB_OUTPUT + echo "milestone_number=$milestone_number" >> $GITHUB_OUTPUT + echo "delivery=allowed" >> $GITHUB_OUTPUT + release: name: Release a new version of the docker image - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: deliverability if: needs.deliverability.outputs.delivery == 'allowed' steps: # git clone - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Merge develop into master (fast forward) and tag master @@ -91,7 +92,7 @@ jobs: run: | tags=($(git tag --sort="-v:refname" | grep -P -e '[0-9]+\.[0-9]+\.[0-9]+')) echo The tag of the previous release is ${tags[1]} - echo "::set-output name=tag::${tags[1]}" + echo "tag=${tags[1]}" >> $GITHUB_OUTPUT # Generate the changelog since last release - name: Generate the changelog uses: charmixer/auto-changelog-action@v1 @@ -117,7 +118,7 @@ jobs: push_to_registry: name: Push Docker image to Docker Hub - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: deliverability if: needs.deliverability.outputs.delivery == 'allowed' steps: @@ -125,19 +126,19 @@ jobs: uses: actions/checkout@v4 - name: Log in to Docker Hub - uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + uses: docker/metadata-action@v5 with: images: ${{ env.DOCKER_IMAGE_NAME }} - name: Build and push Docker image to version number - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + uses: docker/build-push-action@v5 with: context: . file: ${{ env.DOCKERFILE_PATH }}/${{ env.DOCKERFILE_FILENAME }} @@ -145,8 +146,8 @@ jobs: tags: ${{ env.DOCKER_IMAGE_NAME}}:${{ needs.deliverability.outputs.version }} labels: ${{ steps.meta.outputs.labels }} - - name: Build and push Docker image to lastest repo - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + - name: Build and push Docker image to lastest repo + uses: docker/build-push-action@v5 with: context: . file: ${{ env.DOCKERFILE_PATH }}/${{ env.DOCKERFILE_FILENAME }} @@ -154,10 +155,41 @@ jobs: tags: ${{ env.DOCKER_IMAGE_NAME }}:latest labels: ${{ steps.meta.outputs.labels }} + - name: Update repo description + uses: peter-evans/dockerhub-description@v4 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + repository: ${{ env.DOCKER_IMAGE_NAME }} + + - name: Build and push Docker image old name to version number + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ env.DOCKERFILE_PATH }}/${{ env.DOCKERFILE_FILENAME }} + push: true + tags: lequal/sonar-scanner:${{ needs.deliverability.outputs.version }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Build and push Docker image old name to lastest repo + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ env.DOCKERFILE_PATH }}/${{ env.DOCKERFILE_FILENAME }} + push: true + tags: lequal/sonar-scanner:latest + labels: ${{ steps.meta.outputs.labels }} + + - name: Update old name repo description + uses: peter-evans/dockerhub-description@v4 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + repository: lequal/sonar-scanner close_milestone: name: Close the milestone - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: - deliverability - release From f035cb2cf5c55c7981c3ea62db7ff177dc31fc58 Mon Sep 17 00:00:00 2001 From: Topin2001 Date: Thu, 2 May 2024 14:35:53 +0200 Subject: [PATCH 4/8] Change repo name in ci and readme --- .github/workflows/ci.yml | 6 +++--- README.md | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e51d66f..5c0e31e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,13 +25,13 @@ on: env: DOCKERFILE_PATH: '.' DOCKERFILE_FILENAME: 'Dockerfile' - DOCKER_IMAGE_NAME: 'lequal/sonar-scanner' + DOCKER_IMAGE_NAME: 'lequal/sonar-scanner-catlab' jobs: # Job that builds the image and upload it as an artifact build: name: Build the docker image - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - name: Build docker image @@ -46,7 +46,7 @@ jobs: # Jobs that test the image and the embedded tools test: name: Test the Docker image - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: build steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index e8a5247..dc8fac8 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -# CNES sonar-scanner image +# CNES sonar-scanner-catlab image ![](https://github.com/cnescatlab/sonar-scanner/workflows/CI/badge.svg) ![](https://github.com/cnescatlab/sonar-scanner/workflows/CD/badge.svg) > Docker environment containing open source code analysis tools configured by CNES and dedicated to Continuous Integration. -This image is a pre-configured sonar-scanner image derived from [Docker-CAT](https://github.com/cnescatlab/docker-cat). It contains the same tools for code analysis and it is available on Docker Hub at [lequal/sonar-scanner](https://hub.docker.com/r/lequal/sonar-scanner/). +This image is a pre-configured sonar-scanner image derived from [Docker-CAT](https://github.com/cnescatlab/docker-cat). It contains the same tools for code analysis and it is available on Docker Hub at [lequal/sonar-scanner](https://hub.docker.com/r/lequal/sonar-scanner-catlab/). SonarQube itself is an opensource project on GitHub: [SonarSource/sonarqube](https://github.com/SonarSource/sonarqube). -For versions and changelog: [GitHub Releases](https://github.com/cnescatlab/sonar-scanner/releases). +For versions and changelog: [GitHub Releases](https://github.com/cnescatlab/sonar-scanner-catlab/releases). :information_source: If you only need a containerized `sonar-scanner`, you better use the official image from SonarSource available on Docker Hub: [sonarsource/sonar-scanner-cli](https://hub.docker.com/r/sonarsource/sonar-scanner-cli). The official image is smaller because it does not embed any other tool. @@ -24,13 +24,13 @@ Additional features are: - Configuration files - [pylintrc](#how-to-use-embedded-CNES-pylintrc) -_This image is made to be used in conjunction with a pre-configured SonarQube server image that embeds all necessary plugins and configuration: [cnescatlab/sonarqube](https://github.com/cnescatlab/sonarqube). It is, however, not mandatory to use it._ +_This image is made to be used in conjunction with a pre-configured SonarQube server image that embeds all necessary plugins and configuration: [cnescatlab/sonarqube](https://github.com/cnescatlab/sonarqube-catlab). It is, however, not mandatory to use it._ ## User guide 1. Write a `sonar-project.properties` at the root of your project - - For information on what to write in it, see the [official SonarQube documentation](https://docs.sonarqube.org/7.9/analysis/analysis-parameters/) -1. Execute the sonar-scanner on the project by running this image from the root of the project + - For information on what to write in it, see the [official SonarQube documentation](https://docs.sonarqube.org/sonarqube/9.9/) +2. Execute the sonar-scanner on the project by running this image from the root of the project ```sh $ docker run \ --rm \ @@ -51,7 +51,7 @@ _This image is made to be used in conjunction with a pre-configured SonarQube se This image suffers from the same limitations as the official SonarQube [sonarsource/sonar-scanner-cli](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) image. - If you need to analyze .NET projects, you must use the SonarScanner for MSBuild. -- If you want to save the sonar-scanner cache, you must create the directory to bind mount in the container before running it. For more information, see [SonarQube documentation](https://docs.sonarqube.org/8.4/analysis/scan/sonarscanner/#header-6). +- If you want to save the sonar-scanner cache, you must create the directory to bind mount in the container before running it. For more information, see [SonarQube documentation](https://docs.sonarqube.org/sonarqube/9.9/). ### How to use embedded tools From ae99bba1d9129892fac961cded4bc6f8c74f613b Mon Sep 17 00:00:00 2001 From: Topin2001 Date: Thu, 2 May 2024 14:57:21 +0200 Subject: [PATCH 5/8] revert ubuntu version to 22.04 --- .github/workflows/cd.yml | 8 ++++---- .github/workflows/ci.yml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 35074ab..231d118 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -30,7 +30,7 @@ jobs: # Job to test if a new version is ready to be released deliverability: name: Check if a new version must be released - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 # The job is run only if the CI workflow succeeded if: github.event.workflow_run.conclusion == 'success' outputs: @@ -68,7 +68,7 @@ jobs: release: name: Release a new version of the docker image - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 needs: deliverability if: needs.deliverability.outputs.delivery == 'allowed' steps: @@ -118,7 +118,7 @@ jobs: push_to_registry: name: Push Docker image to Docker Hub - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 needs: deliverability if: needs.deliverability.outputs.delivery == 'allowed' steps: @@ -189,7 +189,7 @@ jobs: close_milestone: name: Close the milestone - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 needs: - deliverability - release diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c0e31e..e3d525f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: # Job that builds the image and upload it as an artifact build: name: Build the docker image - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Build docker image @@ -46,7 +46,7 @@ jobs: # Jobs that test the image and the embedded tools test: name: Test the Docker image - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 needs: build steps: - uses: actions/checkout@v2 From e2bf9099b17aaf0e0417ecbc0122694ebab73f2a Mon Sep 17 00:00:00 2001 From: Topin2001 Date: Thu, 2 May 2024 15:12:52 +0200 Subject: [PATCH 6/8] update CI actions version --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3d525f..d394953 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,13 +33,13 @@ jobs: name: Build the docker image runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build docker image run: docker build -t $DOCKER_IMAGE_NAME $DOCKERFILE_PATH - name: Save Docker image run: docker image save -o image.tar $DOCKER_IMAGE_NAME - name: Upload image as an artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: image path: image.tar @@ -49,15 +49,15 @@ jobs: runs-on: ubuntu-22.04 needs: build steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Retrieve the image - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: image - name: Load the image run: docker image load -i image.tar - name: Cache sonar-scanner data - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: .sonarcache key: sonar-scanner-cache From b908fbf9fa82c662e2f19f999445e4de18894865 Mon Sep 17 00:00:00 2001 From: Topin2001 Date: Thu, 2 May 2024 15:46:44 +0200 Subject: [PATCH 7/8] Improve CI test --- .github/workflows/ci.yml | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d394953..795332d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,23 +64,8 @@ jobs: # Run the tests (with the appropriate server image) - name: Test docker image run: | - echo "Retrieving the branch name..." - if [ "${{ github.event_name }}" = "push" ] - then - branch=${{ github.ref }} - branch=${branch#*/} - branch=${branch#*/} - else # PR - branch=${{ github.head_ref }} - fi - echo "Cloning the server repo on branch $branch..." - if ! git clone https://github.com/cnescatlab/sonarqube.git -b "$branch" tmpserver; - then - echo "No branch $branch found on the server repository, using develop" - git clone https://github.com/cnescatlab/sonarqube.git -b develop tmpserver - fi - echo "Building the server image..." - docker build -t lequal/sonarqube:latest tmpserver/ + echo "Retrieving the sonarqube image..." + docker pull lequal/sonarqube-catlab:latest echo "Testing the scanner image..." echo -e "Results of the CI pipeline\n" > tests_logs.txt cd tests/ From 3cbf6ea1c7f620d848977efd07ef9ca5f04493a9 Mon Sep 17 00:00:00 2001 From: Topin2001 Date: Thu, 2 May 2024 16:01:45 +0200 Subject: [PATCH 8/8] change sonarqube image in test python --- .github/workflows/ci.yml | 2 +- tests/test_cnes_sonar_scanner.py | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 795332d..de53165 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: # Run the tests (with the appropriate server image) - name: Test docker image run: | - echo "Retrieving the sonarqube image..." + echo "Retrieving the sonarqube-catlab image..." docker pull lequal/sonarqube-catlab:latest echo "Testing the scanner image..." echo -e "Results of the CI pipeline\n" > tests_logs.txt diff --git a/tests/test_cnes_sonar_scanner.py b/tests/test_cnes_sonar_scanner.py index c92b9af..38e07fa 100644 --- a/tests/test_cnes_sonar_scanner.py +++ b/tests/test_cnes_sonar_scanner.py @@ -18,27 +18,27 @@ class TestCNESSonarScanner: """ This class test the lequal/sonar-scanner image. - It runs a container of the lequal/sonarqube image and run analysis with + It runs a container of the lequal/sonarqube-catlab image and run analysis with lequal/sonar-scanner. It does not build any image. Tests can be parametered with environment variables. Environment variables: - RUN: whether or not to run a lequal/sonarqube container and create a + RUN: whether or not to run a lequal/sonarqube-catlab container and create a bridge network, default "yes", if you already have a running container, set it to "no" and provide information through the other variables. SONARQUBE_CONTAINER_NAME: the name to give to the container running - the lequal/sonarqube image. + the lequal/sonarqube-catlab image. SONARQUBE_ADMIN_PASSWORD: the password of the admin account on the server. - SONARQUBE_URL: URL of lequal/sonarqube container if already running + SONARQUBE_URL: URL of lequal/sonarqube-catlab container if already running without trailing / from the scanner container. e.g. http://mycontainer:9000 Use it only if no container name was given. - SONARQUBE_LOCAL_URL: URL of lequal/sonarqube container if already running + SONARQUBE_LOCAL_URL: URL of lequal/sonarqube-catlab container if already running without trailing / from the host. e.g. http://localhost:9000 - SONARQUBE_TAG: the tag of the lequal/sonarqube image to use. + SONARQUBE_TAG: the tag of the lequal/sonarqube-catlab image to use. e.g. latest SONARQUBE_NETWORK: the name of the docker bridge used. """ @@ -59,15 +59,15 @@ class TestCNESSonarScanner: def setup_class(cls): """ Set up the tests - Launch a lequal/sonarqube container and wait for it to be up + Launch a lequal/sonarqube-catlab container and wait for it to be up """ docker_client = docker.from_env() # Launch a CNES SonarQube container if cls.RUN: print(f"Creating bridge network (name={cls.SONARQUBE_NETWORK})...") docker_client.networks.create(cls.SONARQUBE_NETWORK) - print(f"Launching lequal/sonarqube container (name={cls.SONARQUBE_CONTAINER_NAME})...") - docker_client.containers.run(f"lequal/sonarqube:{cls.SONARQUBE_TAG}", + print(f"Launching lequal/sonarqube-catlab container (name={cls.SONARQUBE_CONTAINER_NAME})...") + docker_client.containers.run(f"lequal/sonarqube-catlab:{cls.SONARQUBE_TAG}", name=cls.SONARQUBE_CONTAINER_NAME, detach=True, auto_remove=True, @@ -126,7 +126,7 @@ def wait_cnes_sonarqube_ready(cls, container_name: str, tail = "all"): This function waits for SonarQube to be configured by the configure.bash script. - :param container_name: name of the container running lequal/sonarqube + :param container_name: name of the container running lequal/sonarqube-catlab :param tail: forwarded to docker logs """ docker_client = docker.from_env()