Skip to content

Commit

Permalink
update pre-commit to run tests
Browse files Browse the repository at this point in the history
Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
  • Loading branch information
joseph-sentry committed Jan 15, 2024
1 parent 6427a54 commit facc22d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@ repos:
pass_filenames: false
require_serial: true
language: system

- id: tests
name: tests
description: "run tests in worker container"
entry: scripts/cexec.sh
args: ["worker", "python", "-m", "pytest"]
pass_filenames: false
require_serial: true
language: script
verbose: true
10 changes: 10 additions & 0 deletions scripts/cexec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
name=$1
shift 1
command="${@}"
if [ $# -eq 0 ]
then
docker exec -t $(docker ps --format "{{.Names}}" --filter "name=$name") /bin/sh
else
docker exec -t $(docker ps --format "{{.Names}}" --filter "name=$name") ${command:-''}
fi

0 comments on commit facc22d

Please sign in to comment.