From 8fd24d02312f9fd7990c1ad0808d561c7b4f80b5 Mon Sep 17 00:00:00 2001 From: Daniil Makhonia <32175481+Makhonya@users.noreply.github.com> Date: Fri, 18 Oct 2024 21:09:31 +0200 Subject: [PATCH] fix(sentry-admin): Do not wait for command finish to display output (#3390) Currently sentry-admin.sh script saves the output of the command to a separate variable. This makes the command "freeze" if it requires any input from the user (like sentry-admin.sh restore). The change should provide the output directly to the shell. Also changed contributing.md as it seemed outdated and updated requirements-dev.txt with the missing `cryptography` package. Co-authored-by: Daniil Makhonia --- CONTRIBUTING.md | 12 +++++++++--- requirements-dev.txt | 1 + sentry-admin.sh | 3 +-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 49120af..3c3e987 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,13 @@ ## Testing -Validate changes to the setup by running the integration test: +### Running Tests with Pytest -```shell -./integration-test.sh +We use pytest for running tests. To run the tests: + +1) Ensure that you are in the root directory of the project. +2) Run the following command: +```bash +pytest ``` + +This will automatically discover and run all test cases in the project. diff --git a/requirements-dev.txt b/requirements-dev.txt index 42bf67b..62b4166 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,3 +5,4 @@ pytest-rerunfailures>=11.0 pytest-sentry>=0.1.11 httpx>=0.25.2 beautifulsoup4>=4.7.1 +cryptography>=43.0.3 diff --git a/sentry-admin.sh b/sentry-admin.sh index d162c82..d775e90 100755 --- a/sentry-admin.sh +++ b/sentry-admin.sh @@ -22,8 +22,7 @@ on the host filesystem. Commands that write files should write them to the '/sen # Actual invocation that runs the command in the container. invocation() { - output=$($dc run -v "$VOLUME_MAPPING" --rm -T -e SENTRY_LOG_LEVEL=CRITICAL web "$@" 2>&1) - echo "$output" + $dc run -v "$VOLUME_MAPPING" --rm -T -e SENTRY_LOG_LEVEL=CRITICAL web "$@" 2>&1 } # Function to modify lines starting with `Usage: sentry` to say `Usage: ./sentry-admin.sh` instead.