Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/test/exclude-perf-tests-from-all…
Browse files Browse the repository at this point in the history
…-tests' into test/exclude-perf-tests-from-all-tests
  • Loading branch information
Fargekritt committed Jan 14, 2025
2 parents 8d5239d + 799d0cf commit a4f4fe0
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions tests/k6/scripts/generate_all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@ fi
IMPORT_STATEMENTS=""
FUNCTION_BODY=""

# Get all *.js files in the directory except for "all-tests.js"
for JS_FILE in "$DIRECTORY_PATH"/*.js; do
if [[ $DIRECTORY_PATH != *"/performance/"* ]]; then
BASE_NAME=$(basename "$JS_FILE" .js)
# Skip files in the "performance" directory or the "all-tests.js" file
if [[ $DIRECTORY_PATH == *"/performance/"* ]] ||
[[ $(basename "$JS_FILE" .js) == "all-tests" ]]; then
continue
fi

if [[ "$BASE_NAME" != "all-tests" ]]; then
# Append to import strings
IMPORT_STATEMENTS="${IMPORT_STATEMENTS}import { default as ${BASE_NAME} } from './${BASE_NAME}.js';"$'\n'
BASE_NAME=$(basename "$JS_FILE" .js)

# Append to function body
FUNCTION_BODY="${FUNCTION_BODY} ${BASE_NAME}();"$'\n'
fi
fi
# Append to import strings
IMPORT_STATEMENTS="${IMPORT_STATEMENTS}import { default as ${BASE_NAME} } from './${BASE_NAME}.js';"$'\n'

# Append to function body
FUNCTION_BODY="${FUNCTION_BODY} ${BASE_NAME}();"$'\n'
done

# Combine all the content
Expand Down

0 comments on commit a4f4fe0

Please sign in to comment.