diff --git a/.circleci/config.yml b/.circleci/config.yml index af26cf4775c..51f188a65ed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,7 +75,7 @@ commands: description: "Install riot" steps: # Make sure we install and run riot on Python 3 - - run: pip3 install riot==0.17.2 + - run: pip3 install riot==0.17.3 save_pip_cache: description: "Save pip cache directory" @@ -145,9 +145,9 @@ commands: DD_TRACE_AGENT_URL: http://localhost:9126 RIOT_RUN_RECOMPILE_REQS: "<< pipeline.parameters.riot_run_latest >>" command: | - mv .riot .ddriot # Sort the hashes to ensure a consistent ordering/division between each node riot list --hash-only '<>' | sort | circleci tests split | xargs -n 1 -I {} ./scripts/ddtest riot -v run --exitfirst --pass-env -s {} $([[ << pipeline.parameters.coverage >> == false ]] && echo '--no-cov' ) + ./scripts/check-diff "Changes detected after running riot. Consider deleting changed files, running scripts/compile-and-prune-test-requirements and committing the result." - unless: condition: << parameters.snapshot >> @@ -166,6 +166,7 @@ commands: command: | # Sort the hashes to ensure a consistent ordering/division between each node riot list --hash-only '<>' | sort | circleci tests split | xargs -n 1 -I {} riot -v run --exitfirst --pass-env -s {} $([[ << pipeline.parameters.coverage >> == false ]] && echo '--no-cov' ) + ./scripts/check-diff "Changes detected after running riot. Consider deleting changed files, running scripts/compile-and-prune-test-requirements and committing the result." - save_pip_cache - when: condition: @@ -422,9 +423,9 @@ jobs: environment: RIOT_RUN_RECOMPILE_REQS: "<< pipeline.parameters.riot_run_latest >>" command: | - mv .riot .ddriot # Sort the hashes to ensure a consistent ordering/division between each node riot list --hash-only 'integration-latest' | sort | circleci tests split | xargs -n 1 -I {} ./scripts/ddtest riot -v run --pass-env -s {} + ./scripts/check-diff "Changes detected after running riot. Consider deleting changed files, running scripts/compile-and-prune-test-requirements and committing the result." integration_testagent: <<: *machine_executor @@ -661,8 +662,8 @@ jobs: environment: RIOT_RUN_RECOMPILE_REQS: "<< pipeline.parameters.riot_run_latest >>" command: | - mv .riot .ddriot ./scripts/ddtest riot -v run --pass-env -s 'gunicorn' + ./scripts/check-diff "Changes detected after running riot. Consider deleting changed files, running scripts/compile-and-prune-test-requirements and committing the result." httplib: <<: *machine_executor diff --git a/.gitignore b/.gitignore index bdd9ea53360..cc1d48c1908 100644 --- a/.gitignore +++ b/.gitignore @@ -68,6 +68,8 @@ coverage.json *,cover .hypothesis/ .pytest_cache/ +test.db +.benchmarks/**/*.json # Translations *.mo diff --git a/docker-compose.yml b/docker-compose.yml index fbd9a946e4c..1f54c90c97a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -166,7 +166,7 @@ services: - ddagent:/tmp/ddagent - ./:/root/project - ./.ddtox:/root/project/.tox - - ./.ddriot:/root/project/.riot + - ./.riot:/root/project/.riot localstack: image: localstack/localstack:1.4.0 diff --git a/scripts/check-diff b/scripts/check-diff index ff55a419025..85055b5465c 100755 --- a/scripts/check-diff +++ b/scripts/check-diff @@ -1,9 +1,13 @@ #!/bin/bash -message=${1:-"Unexpected files changed or added"} +message=${1:-"Files were changed or added."} +changed_files="$(git diff)" +new_files="$(git ls-files -o --exclude-standard)" -if [[ "$(git diff --exit-code)" || ! -z "$(git ls-files -o --exclude-standard)" ]] +if [[ "$(git diff --exit-code)" || -n $new_files ]] then + echo "${changed_files}" + echo "${new_files}" echo "${message}" exit 1 fi diff --git a/scripts/ddtest b/scripts/ddtest index dace9e49e62..b40206aff0a 100755 --- a/scripts/ddtest +++ b/scripts/ddtest @@ -12,7 +12,8 @@ fi # retry docker pull if fails for i in {1..3}; do docker-compose pull -q testrunner && break || sleep 3; done -FULL_CMD="pip install -q --disable-pip-version-check riot==0.17.2 && $CMD" +FULL_CMD="pip install -q --disable-pip-version-check riot==0.17.3 && $CMD" + # install and upgrade riot in case testrunner image has not been updated # DEV: Use `--no-TTY` and `--quiet-pull` when running in CircleCI