diff options
-rw-r--r-- | .pre-commit-config.yaml | 6 | ||||
m--------- | global-jjb | 0 | ||||
-rw-r--r-- | jjb/integration/integration-macros.yaml | 8 | ||||
-rw-r--r-- | jjb/integration/netconf-pnp-simulator-verify.sh | 12 | ||||
-rw-r--r-- | tox.ini | 39 |
5 files changed, 45 insertions, 20 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ca94141f5..497c63417 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: check-executables-have-shebangs @@ -21,12 +21,12 @@ repos: - id: gitlint - repo: https://github.com/adrienverge/yamllint.git - rev: v1.31.0 + rev: v1.34.0 hooks: - id: yamllint - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0-alpha.9-for-vscode + rev: v4.0.0-alpha.8 hooks: - id: prettier stages: [commit] diff --git a/global-jjb b/global-jjb -Subproject 766dbef8a63d824d6e551d4f179806521be95d1 +Subproject 5d336574e77fb349ace15356ef8ffb816d46354 diff --git a/jjb/integration/integration-macros.yaml b/jjb/integration/integration-macros.yaml index 5e9099908..a101a71b4 100644 --- a/jjb/integration/integration-macros.yaml +++ b/jjb/integration/integration-macros.yaml @@ -40,7 +40,7 @@ - builder: name: integration-install-robotframework-py3 builders: - - shell: !include-raw: + - shell: !include-raw-escape: - include-raw-integration-install-robotframework-py3.sh - builder: @@ -48,13 +48,13 @@ builders: - shell: | git clone https://gerrit.onap.org/r/ci-management /tmp/ci-management - cp /tmp/ci-management/jjb/integration/*csit.sh ${WORKSPACE} - ${WORKSPACE}/run-csit.sh ${TESTPLAN} ${TESTOPTIONS} + cp /tmp/ci-management/jjb/integration/*csit.sh "$WORKSPACE" + "$WORKSPACE/run-csit.sh" "$TESTPLAN" "$TESTOPTIONS" - builder: name: integration-run-project-test builders: - - shell: "${WORKSPACE}/csit/run-project-csit.sh ${TESTOPTIONS}" + - shell: "$WORKSPACE/csit/run-project-csit.sh $TESTOPTIONS" - builder: name: integration-autorelease-fix-relativepaths diff --git a/jjb/integration/netconf-pnp-simulator-verify.sh b/jjb/integration/netconf-pnp-simulator-verify.sh index 28e8ae3b6..6617f70c3 100644 --- a/jjb/integration/netconf-pnp-simulator-verify.sh +++ b/jjb/integration/netconf-pnp-simulator-verify.sh @@ -25,7 +25,7 @@ DOCKER_COMPOSE_LOG="/tmp/docker-compose.log" DOCKER_COMPOSE_LOG_MSG=( "success:" "entered RUNNING state" ) DOCKER_COMPOSE_SLEEP_INTERVAL=60 -if [ -z ${NETCONF_SIM_SERVICE_NAME} ]; +if [ -z "$NETCONF_SIM_SERVICE_NAME" ]; then echo "ERROR: netconf-pnp-simulator service name not set." exit 1 @@ -34,17 +34,17 @@ fi pushd $DOCKER_ROOT # Dump container logs -sleep ${DOCKER_COMPOSE_SLEEP_INTERVAL} # Hang for a while so the services settle -docker-compose logs --no-color > ${DOCKER_COMPOSE_LOG} +sleep "$DOCKER_COMPOSE_SLEEP_INTERVAL" # Hang for a while so the services settle +docker-compose logs --no-color > "$DOCKER_COMPOSE_LOG" # Get the supervisord services running within container -supervisord_services=($(docker-compose exec -T ${NETCONF_SIM_SERVICE_NAME} /bin/sh -c \ +supervisord_services=($(docker-compose exec -T "$NETCONF_SIM_SERVICE_NAME" /bin/sh -c \ 'cat /etc/supervisord.conf /etc/supervisord.d/*' | grep -ho "program:[-a-zA-Z0-9]*" | cut -d: -f 2)) # Check all services are running and fail if not -for service in ${supervisord_services[@]}; +for service in "${{supervisord_services[@]}}"; do - if ! grep -q "${DOCKER_COMPOSE_LOG_MSG[0]} $service ${DOCKER_COMPOSE_LOG_MSG[1]}" ${DOCKER_COMPOSE_LOG}; + if ! grep -q "${{DOCKER_COMPOSE_LOG_MSG[0]}} $service ${{DOCKER_COMPOSE_LOG_MSG[1]}}" "$DOCKER_COMPOSE_LOG"; then echo "ERROR: Service $service is not running, failing the build." exit 1 @@ -1,13 +1,38 @@ [tox] minversion = 1.6 -envlist = coala +envlist = jjb-version skipsdist = true -[testenv:coala] -basepython = python3 +[testenv:jenkins-jobs] deps = - coala - coala-bears + jenkins-job-builder=={env:JJB_VERSION:6.0.0} +commands = + jenkins-jobs {posargs:--help} + +[testenv:jjb-version] +commands = python {toxinidir}/check_jjb_version.py + +[testenv:pre-commit-install] +basepython = python3 +deps = pre-commit +commands = + pre-commit install + pre-commit install --hook-type commit-msg + +[testenv:pre-commit-uninstall] +basepython = python3 +deps = pre-commit +commands = + pre-commit uninstall + pre-commit uninstall --hook-type commit-msg + +[testenv:pre-commit] +basepython = python3 +deps = pre-commit +passenv = HOME commands = - python3 -m nltk.downloader punkt maxent_treebank_pos_tagger averaged_perceptron_tagger - coala --non-interactive + pre-commit run --all-files --show-diff-on-failure + pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG + # Gitlint only proposes a pre-commit configuration for the commit-msg stage but none for the commit stage. + # Its default arguments --passed and --msg-filename are different from CI recommandations. + # As a result, the line above is always skipped in jenkins CI since there cannot be a .git/COMMIT_EDITMSG file. |