Skip to content

Commit

Permalink
removed performance from auto gen of all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Fargekritt committed Jan 14, 2025
1 parent 50b52cb commit 31e5f27
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions tests/k6/scripts/generate_all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ FUNCTION_BODY=""

# Get all *.js files in the directory except for "all-tests.js"
for JS_FILE in "$DIRECTORY_PATH"/*.js; do
BASE_NAME=$(basename "$JS_FILE" .js)

if [[ "$BASE_NAME" != "all-tests" ]]; then
# 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'
if [[ $DIRECTORY_PATH != *"performance"* ]]; then
BASE_NAME=$(basename "$JS_FILE" .js)

if [[ "$BASE_NAME" != "all-tests" ]]; then
# 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'
fi
fi
done

Expand All @@ -33,6 +35,6 @@ export default function() {
${FUNCTION_BODY}}"

# Output the script content to "all-tests.js"
echo "$SCRIPT_CONTENT" > "${DIRECTORY_PATH}/all-tests.js"
echo "$SCRIPT_CONTENT" >"${DIRECTORY_PATH}/all-tests.js"

echo "all-tests.js has been generated successfully."

0 comments on commit 31e5f27

Please sign in to comment.