-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tests): mock telemetry config (#7168)
### Description Mock config for telemetry tests Closes TURBO-2189
- Loading branch information
Showing
5 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
read -r -d '' CONFIG <<- EOF | ||
{ | ||
"telemetry_enabled": true | ||
} | ||
EOF | ||
|
||
TMP_DIR=$(mktemp -d -t turbo-XXXXXXXXXX) | ||
|
||
# duplicate over to XDG var so that turbo picks it up | ||
export XDG_CONFIG_HOME=$TMP_DIR | ||
export HOME=$TMP_DIR | ||
export TURBO_TELEMETRY_MESSAGE_DISABLED=1 | ||
export TURBO_CONFIG_DIR_PATH=$TMP_DIR | ||
|
||
# For Linux | ||
mkdir -p "$TMP_DIR/turborepo" | ||
echo $CONFIG > "$TMP_DIR/turborepo/telemetry_config.json" | ||
|
||
# For macOS | ||
MACOS_DIR="$TMP_DIR/Library/Application Support" | ||
mkdir -p "$MACOS_DIR/turborepo" | ||
echo "$CONFIG" > "$MACOS_DIR/turborepo/telemetry_config.json" |
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