diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/bots-automerge.yml similarity index 51% rename from .github/workflows/dependabot-automerge.yml rename to .github/workflows/bots-automerge.yml index 10f62e51..f7798358 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/bots-automerge.yml @@ -1,5 +1,5 @@ -# Set as automatically merge all the pull requests created by dependabot[bot] -name: Dependabot auto-merge +# Set as automatically merge all the pull requests created by dependabot[bot], red-hat-konflux[bot], InsightsDroid. +name: Bots auto-merge on: pull_request # This section adds write permissions to the secrets.GITHUB_TOKEN. Default is just read @@ -8,30 +8,27 @@ permissions: pull-requests: write jobs: - dependabot: + bot-automerge: runs-on: ubuntu-latest - if: github.actor == 'dependabot[bot]' + # Check the pull request author. + if: | + github.event.pull_request.user.login == 'dependabot[bot]' || + github.event.pull_request.user.login == 'red-hat-konflux[bot]' || + github.event.pull_request.user.login == 'InsightsDroid' steps: - - name: Dependabot metadata - id: metadata - uses: dependabot/fetch-metadata@v1 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" + # NOTE: PR approval does not work on PRs from forks - name: Github Actions bot approves the PR run: gh pr review --approve "$PR_URL" env: - PR_URL: ${{github.event.pull_request.html_url}} - GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{ github.token }} - name: InsightsDroid approves the PR run: gh pr review --approve "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} GH_TOKEN: ${{secrets.INSIGHTSDROID_TOKEN}} - - name: Enable auto-merge for Dependabot PRs - # We can filter depending on the semver major, minor, or patch updates, - # but let's not do it for now - # if: steps.metadata.outputs.update-type == 'version-update:semver-patch' + - name: Enable auto-merge for PR run: gh pr merge --auto --merge "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} - GH_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file + GH_TOKEN: ${{ github.token }} diff --git a/CODEOWNERS b/CODEOWNERS deleted file mode 100644 index 4e22b03f..00000000 --- a/CODEOWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# CCX Processing team members are the default owners of the repository -* @tisnik @Bee-lee @JoseLSegura @matysek @epapbak @JiriPapousek @juandspy @Jakub007d @falox diff --git a/Dockerfile b/Dockerfile index f31a927b..f548e9f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,16 +24,11 @@ ENV VIRTUAL_ENV=/insights-behavioral-spec-venv \ WORKDIR $HOME ENV PATH="$VIRTUAL_ENV/bin:$PATH" - -RUN microdnf install --nodocs -y python3.11 unzip make lsof git libpq-devel tar - -RUN python3.11 -m venv $VIRTUAL_ENV && source $VIRTUAL_ENV/bin/activate - -RUN pip install --no-cache-dir -U pip setuptools wheel - -COPY requirements/requirements_docker.txt $HOME/requirements/ - -RUN pip install --no-cache-dir -r requirements/requirements_docker.txt +COPY requirements.txt $HOME/ +RUN microdnf install --nodocs -y python3.11 unzip make lsof git libpq-devel tar &&\ + python3.11 -m venv $VIRTUAL_ENV && source $VIRTUAL_ENV/bin/activate &&\ + pip install --no-cache-dir -U pip wheel &&\ + pip install --no-cache-dir -r requirements.txt COPY . $HOME @@ -45,4 +40,4 @@ COPY --from=quay.io/ccxdev/ccx-kcat:1.7.1 /usr/local/bin/kcat $VIRTUAL_ENV_BIN/k USER 1001 -CMD ["sh", "-c", "make $TESTS_TO_EXECUTE"] +CMD ["sh", "-c", "make $TESTS_TO_EXECUTE"] \ No newline at end of file diff --git a/README.md b/README.md index 69bce8ec..8ad4d442 100644 --- a/README.md +++ b/README.md @@ -78,3 +78,4 @@ Please look at [this page](https://redhatinsights.github.io/insights-behavioral- ## Additional tools This repository contains additional tools and helpers. Description of such tools can be found on [this page](https://redhatinsights.github.io/insights-behavioral-spec/tools.html) + diff --git a/ccx_upgrade_risk_data_eng_tests.sh b/ccx_upgrade_risk_data_eng_tests.sh index bbb6bd79..ad148110 100755 --- a/ccx_upgrade_risk_data_eng_tests.sh +++ b/ccx_upgrade_risk_data_eng_tests.sh @@ -23,13 +23,13 @@ PATH_TO_LOCAL_DATA_ENG_SERVICE=${PATH_TO_LOCAL_DATA_ENG_SERVICE:="../ccx-upgrade [ "$VIRTUAL_ENV" != "" ] || NOVENV=1 function install_reqs() { - pip install -r requirements.txt + pip install -r requirements.txt || exit 1 } function prepare_venv() { echo "Preparing environment" # shellcheck disable=SC1091 - virtualenv -p python3 venv && source venv/bin/activate && pip install -r requirements/upgrades_data_eng_service.txt + virtualenv -p python3 venv && source venv/bin/activate && install_reqs echo "Environment ready" } @@ -69,8 +69,8 @@ function add_exit_trap { # prepare virtual environment if necessary case "$NOVENV" in - "") echo "using existing virtual env";; - "1") install_reqs && prepare_venv ;; + "") echo "using existing virtual env" && install_reqs;; + "1") prepare_venv ;; esac # Copy the binary and configuration to this folder diff --git a/ccx_upgrade_risk_inference_tests.sh b/ccx_upgrade_risk_inference_tests.sh index a7edf66c..78624d7d 100755 --- a/ccx_upgrade_risk_inference_tests.sh +++ b/ccx_upgrade_risk_inference_tests.sh @@ -23,13 +23,13 @@ PATH_TO_LOCAL_INFERENCE_SERVICE=${PATH_TO_LOCAL_INFERENCE_SERVICE:="../ccx-upgra [ "$VIRTUAL_ENV" != "" ] || NOVENV=1 function install_reqs() { - pip install -r requirements.txt + pip install -r requirements.txt || exit 1 } function prepare_venv() { echo "Preparing environment" # shellcheck disable=SC1091 - virtualenv -p python3 venv && source venv/bin/activate && pip install -r requirements/upgrades_inference_service.txt + virtualenv -p python3 venv && source venv/bin/activate && install_reqs echo "Environment ready" } @@ -59,8 +59,8 @@ function add_exit_trap { # prepare virtual environment if necessary case "$NOVENV" in - "") echo "using existing virtual env";; - "1") install_reqs && prepare_venv ;; + "") echo "using existing virtual env" && install_reqs;; + "1") prepare_venv ;; esac # Copy the binary and configuration to this folder diff --git a/cleaner_tests.sh b/cleaner_tests.sh index 97b100d6..ea7ff5b1 100755 --- a/cleaner_tests.sh +++ b/cleaner_tests.sh @@ -14,10 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +function install_reqs() { + pip install -r requirements.txt || exit 1 +} + function prepare_venv() { echo "preparing virtual environment for tests execution" # shellcheck disable=SC1091 - python3 -m venv venv && source venv/bin/activate && pip install -r requirements.txt || exit 1 + python3 -m venv venv && source venv/bin/activate && install_reqs echo "Environment ready" } @@ -66,7 +70,7 @@ fi # prepare virtual environment if necessary [ "$VIRTUAL_ENV" != "" ] || NOVENV=1 case "$NOVENV" in - "") echo "using existing virtual env";; + "") echo "using existing virtual env" && install_reqs;; "1") prepare_venv;; esac diff --git a/docker-compose.yml b/docker-compose.yml index 4ae94481..5a6114ef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.9" services: # "pod" with the tests bddtests: - image: quay.io/cloudservices/insights-behavioral-spec:latest + image: quay.io/redhat-services-prod/obsint-processing-tenant/insights-behavioral-spec/insights-behavioral-spec:latest entrypoint: - /bin/sh - -c diff --git a/docs/BDD_intro.md b/docs/BDD_intro.md index 67d6a1ec..5e14b348 100644 --- a/docs/BDD_intro.md +++ b/docs/BDD_intro.md @@ -346,7 +346,6 @@ def after_all(context): │ ├── adder.feature │ └── steps │ └── common.py -├── requirements.in ├── requirements.txt ├── run_tests.sh └── src @@ -357,7 +356,7 @@ def after_all(context): ``` src/adder.py tested module -requirements.in/requirements.txt used by PIP +requirements.txt used by PIP feature_list.txt list of test scenarios features/ test scenario(s) + implementation of test steps run_tests.sh helper script to run Behave diff --git a/dvo_extractor_tests.sh b/dvo_extractor_tests.sh index 6fd928fc..a793c160 100755 --- a/dvo_extractor_tests.sh +++ b/dvo_extractor_tests.sh @@ -20,14 +20,14 @@ export PATH_TO_LOCAL_DVO_EXTRACTOR=${PATH_TO_LOCAL_DVO_EXTRACTOR:="../dvo-extrac exit_trap_command="" +function install_reqs() { + pip install -r requirements.txt || exit 1 +} + function prepare_venv() { echo "Preparing environment" # shellcheck disable=SC1091 - virtualenv -p python3 venv - # shellcheck disable=SC1091 - source venv/bin/activate - pip install --no-cache -r requirements.in || exit 1 - pip install --no-cache -r requirements/dvo_extractor.txt || exit 1 + virtualenv -p python3 venv && source venv/bin/activate && install_reqs echo "Environment ready" } @@ -97,6 +97,8 @@ fi if [ "$NOVENV" ] ; then prepare_venv +else + install_reqs fi install_extractor diff --git a/dvo_writer_tests.sh b/dvo_writer_tests.sh index c963ba89..7af8f9c7 100755 --- a/dvo_writer_tests.sh +++ b/dvo_writer_tests.sh @@ -14,10 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +function install_reqs() { + pip install -r requirements.txt || exit 1 +} + function prepare_venv() { echo "Preparing environment" # shellcheck disable=SC1091 - virtualenv -p python3 venv && source venv/bin/activate && python3 "$(which pip3)" install -r requirements/dvo_writer.txt || exit 1 + virtualenv -p python3 venv && source venv/bin/activate && install_reqs echo "Environment ready" } @@ -66,7 +70,7 @@ fi # prepare virtual environment if necessary [ "$VIRTUAL_ENV" != "" ] || NOVENV=1 case "$NOVENV" in - "") echo "using existing virtual env";; + "") echo "using existing virtual env" && install_reqs;; "1") prepare_venv ;; esac diff --git a/exporter_tests.sh b/exporter_tests.sh index 9ab605b1..c626cc1b 100755 --- a/exporter_tests.sh +++ b/exporter_tests.sh @@ -1,6 +1,6 @@ #!/bin/bash -x -# Copyright 2022, 2023 Red Hat, Inc +# Copyright 2022, 2023, 2024 Red Hat, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,10 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +function install_reqs() { + pip install -r requirements.txt || exit 1 +} + function prepare_venv() { echo "Preparing environment" # shellcheck disable=SC1091 - virtualenv -p python3 venv && source venv/bin/activate && pip install -r requirements/exporter.txt || exit 1 + virtualenv -p python3 venv && source venv/bin/activate && install_reqs echo "Environment ready" } @@ -73,11 +77,10 @@ fi # prepare virtual environment if necessary [ "$VIRTUAL_ENV" != "" ] || NOVENV=1 case "$NOVENV" in - "") echo "using existing virtual env";; + "") echo "using existing virtual env" && install_reqs;; "1") prepare_venv;; esac - if [[ -n $ENV_DOCKER ]] then # set env vars diff --git a/features/insights-results-aggregator/starting_service.feature b/features/insights-results-aggregator/starting_service.feature index ed4161b1..186e47e3 100644 --- a/features/insights-results-aggregator/starting_service.feature +++ b/features/insights-results-aggregator/starting_service.feature @@ -27,5 +27,5 @@ Feature: Checking Aggregator behaviour during starting the service And I run the Insights Results Aggregator with the start-service command line flag and config file name set to config/insights_results_aggregator_wrong_kafka.tom Then The process should finish with exit code 1 And I should see following message in service output: "Failed to connect to broker" - And I should see following message in service output: "kafka: client has run out of available brokers to talk to (Is your cluster reachable?)" + And I should see following message in service output: "kafka: client has run out of available brokers to talk to" And I should see following message in service output: "waiting for consumer to start" diff --git a/features/steps/insights_content_service.py b/features/steps/insights_content_service.py index 9b82f9fe..bd0b2d85 100644 --- a/features/steps/insights_content_service.py +++ b/features/steps/insights_content_service.py @@ -66,9 +66,10 @@ def check_utils_version(context): def check_groups(context): """Check if groups attribute contains all expected group names.""" groups = context.response.json()["groups"] - assert len(groups) == 4, f"groups number is {len(groups)}" + assert len(groups) == 5, f"groups number is {len(groups)}" - expected = ["Performance", "Service Availability", "Security", "Fault Tolerance"] + expected = ["Performance", "Service Availability", "Security", + "Fault Tolerance", "Best Practices"] for i, group in enumerate(groups): err_msg = f"{groups[i]['title']} not in {expected}" assert group["title"] in expected, err_msg diff --git a/insights_content_service_test.sh b/insights_content_service_test.sh index e6d26fbc..49ca926a 100755 --- a/insights_content_service_test.sh +++ b/insights_content_service_test.sh @@ -23,8 +23,7 @@ function prepare_venv() { virtualenv -p python3 venv # shellcheck disable=SC1091 source venv/bin/activate - pip install --no-cache -r requirements.in || exit 1 - pip install --no-cache -r requirements/insights_content_service.txt || exit 1 + pip install --no-cache -r requirements.txt || exit 1 echo "Environment ready" } diff --git a/insights_content_template_renderer_tests.sh b/insights_content_template_renderer_tests.sh index 2db2a2fc..2a5887fe 100755 --- a/insights_content_template_renderer_tests.sh +++ b/insights_content_template_renderer_tests.sh @@ -27,23 +27,28 @@ function clone_service() { [ "$VIRTUAL_ENV" != "" ] || NOVENV=1 function install_reqs() { - pip install -r requirements.txt - pip install -r requirements/insights_content_template_renderer.txt + pip install -r requirements.txt || exit 1 } function prepare_venv() { echo "Preparing environment" # shellcheck disable=SC1091 - virtualenv -p python3 venv && source venv/bin/activate + virtualenv -p python3 venv && source venv/bin/activate && install_reqs echo "Environment ready" } function install_service() { cd "$PATH_TO_LOCAL_TEMPLATE_RENDERER" || exit - pip install -r requirements.txt + install_reqs cd "$dir_path" || exit } +# prepare virtual environment if necessary +case "$NOVENV" in + "") echo "using existing virtual env" && install_reqs;; + "1") prepare_venv ;; +esac + if [ ! -d "$PATH_TO_LOCAL_TEMPLATE_RENDERER" ]; then if [[ -z $ENV_DOCKER ]] then @@ -57,8 +62,6 @@ else echo "insights-content-template-renderer directory found in working directory" fi -[ "$NOVENV" != "1" ] || prepare_venv || exit 1 -install_reqs # Copy the binary and configuration to this folder install_service diff --git a/insights_results_aggregator_mock_tests.sh b/insights_results_aggregator_mock_tests.sh index 9c861e63..3db899b8 100755 --- a/insights_results_aggregator_mock_tests.sh +++ b/insights_results_aggregator_mock_tests.sh @@ -14,10 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +function install_reqs() { + pip install -r requirements.txt || exit 1 +} + function prepare_venv() { echo "Preparing environment" # shellcheck disable=SC1091 - virtualenv -p python3 venv && source venv/bin/activate && pip install -r requirements/insights_results_aggregator_mock.txt || exit 1 + virtualenv -p python3 venv && source venv/bin/activate && install_reqs echo "Environment ready" } @@ -47,7 +51,7 @@ EOF # prepare virtual environment if necessary [ "$VIRTUAL_ENV" != "" ] || NOVENV=1 case "$NOVENV" in - "") echo "using existing virtual env";; + "") echo "using existing virtual env" && install_reqs;; "1") prepare_venv ;; esac diff --git a/insights_results_aggregator_tests.sh b/insights_results_aggregator_tests.sh index 574f76d9..3e4bb415 100755 --- a/insights_results_aggregator_tests.sh +++ b/insights_results_aggregator_tests.sh @@ -14,10 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +function install_reqs() { + pip install -r requirements.txt || exit 1 +} + function prepare_venv() { echo "Preparing environment" # shellcheck disable=SC1091 - virtualenv -p python3 venv && source venv/bin/activate && pip install -r requirements/insights_results_aggregator_mock.txt || exit 1 + virtualenv -p python3 venv && source venv/bin/activate && install_reqs echo "Environment ready" } @@ -66,7 +70,7 @@ fi # prepare virtual environment if necessary [ "$VIRTUAL_ENV" != "" ] || NOVENV=1 case "$NOVENV" in - "") echo "using existing virtual env";; + "") echo "using existing virtual env" && install_reqs;; "1") prepare_venv ;; esac diff --git a/insights_sha_extractor_test.sh b/insights_sha_extractor_test.sh index ca46984f..c22f068f 100755 --- a/insights_sha_extractor_test.sh +++ b/insights_sha_extractor_test.sh @@ -32,13 +32,12 @@ function clone_service() { function install_reqs() { pip install -r requirements.txt - pip install -r requirements/insights_sha_extractor.txt } function prepare_venv() { echo "Preparing environment" # shellcheck disable=SC1091 - virtualenv -p python3 venv && source venv/bin/activate + virtualenv -p python3 venv && source venv/bin/activate && install reqs echo "Environment ready" } @@ -115,7 +114,6 @@ if ! [ "$ENV_DOCKER" ] ; then fi [ "$NOVENV" != "1" ] || prepare_venv || exit 1 -install_reqs # Copy the binary and configuration to this folder install_service diff --git a/notification_service_tests.sh b/notification_service_tests.sh index ce733ade..74b4d155 100755 --- a/notification_service_tests.sh +++ b/notification_service_tests.sh @@ -24,13 +24,13 @@ PATH_TO_LOCAL_NOTIFICATION_WRITER="../ccx-notification-writer" [ "$VIRTUAL_ENV" != "" ] || NOVENV=1 function install_reqs() { - pip install -r requirements.txt + pip install -r requirements.txt || exit 1 } function prepare_venv() { echo "Preparing environment" # shellcheck disable=SC1091 - virtualenv -p python3 venv && source venv/bin/activate && pip install -r requirements/notification_service.txt + virtualenv -p python3 venv && source venv/bin/activate && install_reqs echo "Environment ready" } @@ -163,8 +163,8 @@ fi # prepare virtual environment if necessary case "$NOVENV" in - "") echo "using existing virtual env";; - "1") install_reqs && prepare_venv ;; + "") echo "using existing virtual env" && install_reqs;; + "1") prepare_venv ;; esac #launch mocked services if WITHMOCK is provided diff --git a/notification_writer_tests.sh b/notification_writer_tests.sh index 63d63e9c..d0fce4bd 100755 --- a/notification_writer_tests.sh +++ b/notification_writer_tests.sh @@ -14,10 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +function install_reqs() { + pip install -r requirements.txt || exit 1 +} + function prepare_venv() { echo "Preparing environment" # shellcheck disable=SC1091 - virtualenv -p python3 venv && source venv/bin/activate && pip install -r requirements/notification_writer.txt || exit 1 + virtualenv -p python3 venv && source venv/bin/activate && install_reqs echo "Environment ready" } @@ -73,7 +77,7 @@ fi # prepare virtual environment if necessary [ "$VIRTUAL_ENV" != "" ] || NOVENV=1 case "$NOVENV" in - "") echo "using existing virtual env";; + "") echo "using existing virtual env" && install_reqs;; "1") prepare_venv ;; esac diff --git a/parquet_factory_tests.sh b/parquet_factory_tests.sh index 25869768..606402f7 100755 --- a/parquet_factory_tests.sh +++ b/parquet_factory_tests.sh @@ -22,13 +22,13 @@ PATH_TO_LOCAL_PARQUET_FACTORY=${PATH_TO_LOCAL_PARQUET_FACTORY:="../parquet-facto [ "$VIRTUAL_ENV" != "" ] || NOVENV=1 function install_reqs() { - pip install -r requirements.txt + pip install -r requirements.txt || exit 1 } function prepare_venv() { echo "Preparing environment" # shellcheck disable=SC1091 - virtualenv -p python3 venv && source venv/bin/activate && pip install -r requirements/parquet-factory.txt || exit 1 + virtualenv -p python3 venv && source venv/bin/activate && install_reqs echo "Environment ready" } @@ -95,8 +95,8 @@ fi # prepare virtual environment if necessary case "$NOVENV" in - "") echo "using existing virtual env";; - "1") install_reqs && prepare_venv ;; + "") echo "using existing virtual env" && install_reqs;; + "1") prepare_venv ;; esac set_env_vars diff --git a/requirements.in b/requirements.in deleted file mode 100644 index e6829504..00000000 --- a/requirements.in +++ /dev/null @@ -1,5 +0,0 @@ -behave -pytest -requests -psycopg2-binary -semver diff --git a/requirements.txt b/requirements.txt index 84659989..6124c94f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,24 @@ +PyYAML behave -pytest +boto3 +fastapi +jsonschema +kafka-python +minio +numpy +pandas psycopg2-binary +pyarrow +pytest +python-multipart +requests semver +sentry-sdk +toml +types-PyYAML +types-jsonschema +types-psycopg2 +types-requests +uvicorn[standard] +virtualenv +setuptools>=70.0.0 \ No newline at end of file diff --git a/requirements/dvo_extractor.txt b/requirements/dvo_extractor.txt deleted file mode 100644 index 800ac12e..00000000 --- a/requirements/dvo_extractor.txt +++ /dev/null @@ -1,5 +0,0 @@ -boto3 -fastapi -kafka-python -minio -uvicorn[standard] \ No newline at end of file diff --git a/requirements/dvo_writer.txt b/requirements/dvo_writer.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/requirements/exporter.txt b/requirements/exporter.txt deleted file mode 100644 index 45ef311b..00000000 --- a/requirements/exporter.txt +++ /dev/null @@ -1,4 +0,0 @@ -behave -pytest -minio -psycopg2-binary diff --git a/requirements/insights_content_service.txt b/requirements/insights_content_service.txt deleted file mode 100644 index 6feb2b6f..00000000 --- a/requirements/insights_content_service.txt +++ /dev/null @@ -1,3 +0,0 @@ -jsonschema -minio -kafka-python \ No newline at end of file diff --git a/requirements/insights_content_template_renderer.txt b/requirements/insights_content_template_renderer.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/requirements/insights_results_aggregator.txt b/requirements/insights_results_aggregator.txt deleted file mode 100644 index c66af509..00000000 --- a/requirements/insights_results_aggregator.txt +++ /dev/null @@ -1,4 +0,0 @@ -behave -pytest -requests -semver diff --git a/requirements/insights_results_aggregator_mock.txt b/requirements/insights_results_aggregator_mock.txt deleted file mode 100644 index afd0811a..00000000 --- a/requirements/insights_results_aggregator_mock.txt +++ /dev/null @@ -1,3 +0,0 @@ -behave -pytest -requests diff --git a/requirements/insights_sha_extractor.txt b/requirements/insights_sha_extractor.txt deleted file mode 100644 index 800ac12e..00000000 --- a/requirements/insights_sha_extractor.txt +++ /dev/null @@ -1,5 +0,0 @@ -boto3 -fastapi -kafka-python -minio -uvicorn[standard] \ No newline at end of file diff --git a/requirements/mocks.txt b/requirements/mocks.txt deleted file mode 100644 index 8613a86a..00000000 --- a/requirements/mocks.txt +++ /dev/null @@ -1,3 +0,0 @@ -fastapi -uvicorn[standard] -python-multipart \ No newline at end of file diff --git a/requirements/mypy.txt b/requirements/mypy.txt deleted file mode 100644 index 84f39f2d..00000000 --- a/requirements/mypy.txt +++ /dev/null @@ -1,4 +0,0 @@ -types-psycopg2 -types-PyYAML -types-jsonschema -types-requests diff --git a/requirements/notification_service.txt b/requirements/notification_service.txt deleted file mode 100644 index 96a383ee..00000000 --- a/requirements/notification_service.txt +++ /dev/null @@ -1,6 +0,0 @@ -behave -pytest -requests -psycopg2-binary -minio -kafka-python diff --git a/requirements/notification_writer.txt b/requirements/notification_writer.txt deleted file mode 100644 index 9455ddaa..00000000 --- a/requirements/notification_writer.txt +++ /dev/null @@ -1,4 +0,0 @@ -behave -pytest -psycopg2-binary -kafka-python diff --git a/requirements/parquet-factory.txt b/requirements/parquet-factory.txt deleted file mode 100644 index bb6c23d3..00000000 --- a/requirements/parquet-factory.txt +++ /dev/null @@ -1,6 +0,0 @@ -behave -kafka-python -minio -pandas -pyarrow -numpy diff --git a/requirements/requirements_docker.txt b/requirements/requirements_docker.txt deleted file mode 100644 index 2a4fd24d..00000000 --- a/requirements/requirements_docker.txt +++ /dev/null @@ -1,17 +0,0 @@ -behave -pytest -psycopg2-binary -fastapi -uvicorn[standard] -python-multipart -requests -minio -jsonschema -kafka-python -virtualenv -semver -pandas -pyarrow -numpy -boto3 -toml diff --git a/requirements/upgrades_data_eng_service.txt b/requirements/upgrades_data_eng_service.txt deleted file mode 100644 index 29c3a375..00000000 --- a/requirements/upgrades_data_eng_service.txt +++ /dev/null @@ -1,6 +0,0 @@ -behave -pytest -requests -psycopg2-binary -minio -jsonschema diff --git a/requirements/upgrades_inference_service.txt b/requirements/upgrades_inference_service.txt deleted file mode 100644 index 29c3a375..00000000 --- a/requirements/upgrades_inference_service.txt +++ /dev/null @@ -1,6 +0,0 @@ -behave -pytest -requests -psycopg2-binary -minio -jsonschema diff --git a/run_in_docker.sh b/run_in_docker.sh index 6a48e24f..436f0331 100755 --- a/run_in_docker.sh +++ b/run_in_docker.sh @@ -141,7 +141,7 @@ fi # Step 4: Launch containers # shellcheck disable=SC2046 -POSTGRES_DB_NAME="$db_name" docker-compose $(with_profile "$1") $(with_no_mock "$3") up -d +POSTGRES_DB_NAME="$db_name" docker compose $(with_profile "$1") $(with_no_mock "$3") up -d # Step 5: Find the container ID of the insights-behavioral-spec container cid=$(docker ps | grep 'insights-behavioral-spec:latest' | cut -d ' ' -f 1) diff --git a/run_tests.sh b/run_tests.sh index 85d47543..cd73f2b9 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -1,18 +1,18 @@ #!/bin/bash -x +function install_reqs() { + pip install -r requirements.txt || exit 1 +} + function prepare_venv() { # shellcheck disable=SC1091 - virtualenv -p python3 venv && source venv/bin/activate - pip install -r requirements.txt - for f in requirements/*.txt; do - echo "File -> $f" && pip install -r "$f" || exit 1 - done + virtualenv -p python3 venv && source venv/bin/activate && install_reqs } # prepare virtual environment if necessary [ "$VIRTUAL_ENV" != "" ] || NOVENV=1 case "$NOVENV" in - "") echo "using existing virtual env";; + "") echo "using existing virtual env" && install_reqs;; "1") prepare_venv;; esac diff --git a/smart_proxy_tests.sh b/smart_proxy_tests.sh index 420cdcdb..86ccf929 100755 --- a/smart_proxy_tests.sh +++ b/smart_proxy_tests.sh @@ -19,13 +19,13 @@ [ "$VIRTUAL_ENV" != "" ] || NOVENV=1 function install_reqs() { - pip install -r requirements.txt + pip install -r requirements.txt || exit 1 } function prepare_venv() { echo "Preparing environment" # shellcheck disable=SC1091 - virtualenv -p python3 venv && source venv/bin/activate && pip install -r requirements/insights_results_aggregator_mock.txt || exit 1 + virtualenv -p python3 venv && source venv/bin/activate && install_reqs echo "Environment ready" } @@ -67,8 +67,8 @@ fi # prepare virtual environment if necessary case "$NOVENV" in - "") echo "using existing virtual env";; - "1") install_reqs && prepare_venv ;; + "") echo "using existing virtual env" && install_reqs;; + "1") prepare_venv ;; esac if [[ -n $ENV_DOCKER ]]