-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tech - Ajoute quelques commandes au Makefile (#3552)
## Linked issues None ---- - [ ] Tests E2E (Cypress)
- Loading branch information
Showing
3 changed files
with
56 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
while true; do | ||
echo "Listing Git dirty .kt files..." | ||
GIT_CHANGED_KT_FILES=$(git status --porcelain | grep '\.kt$' | awk '{print $2}') | ||
GIT_UNTRACKED_KT_FILES=$(git ls-files --others --exclude-standard | grep '\.kt$') | ||
GIT_DIRTY_KT_FILES=$(echo -e "$GIT_CHANGED_KT_FILES\n$GIT_UNTRACKED_KT_FILES" | grep '\.kt$') | ||
|
||
if [ ! -z "$GIT_DIRTY_KT_FILES" ]; then | ||
echo "Found Git dirty .kt files: $GIT_DIRTY_KT_FILES" | ||
|
||
TEST_COMMAND_ARGS="" | ||
for FILE in $GIT_DIRTY_KT_FILES; do | ||
# Extract test pathed class name | ||
TEST_CLASS=$(echo $FILE | sed -e 's#backend/src/test/kotlin/##' -e 's#/#.#g' -e 's/.kt$//') | ||
TEST_COMMAND_ARGS="$TEST_COMMAND_ARGS --tests $TEST_CLASS" | ||
done | ||
echo "Running tests for: $TEST_COMMAND_ARGS..." | ||
(cd backend && ./gradlew test $TEST_COMMAND_ARGS) | ||
else | ||
echo "No Git dirty .kt file detected." | ||
fi | ||
|
||
echo "Watching for .kt file changes..." | ||
inotifywait -e create -e modify -e move -e delete -r backend/src/main/kotlin backend/src/test/kotlin || echo "No files specified to watch!" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters