Skip to content

Commit

Permalink
fix(sentry-admin): Do not wait for command finish to display output (#…
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
Makhonya and Daniil Makhonia authored Oct 18, 2024
1 parent f0f854c commit 8fd24d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions sentry-admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 8fd24d0

Please sign in to comment.