forked from objectionary/eo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request objectionary#2086 from volodya-lombrozo/highload_test
test(objectionary#2085): Test repetition at night
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: daily | ||
on: | ||
schedule: | ||
# Run load testing at 01:30 UTC every day | ||
- cron: '30 1 * * *' | ||
jobs: | ||
build: | ||
runs-on: [ ubuntu-latest, macos-latest ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: | | ||
SCRIPT="${GITHUB_WORKSPACE}/src/test/scrips/test-repetition.sh" | ||
# Make script runnable | ||
chmod +x "${GITHUB_WORKSPACE}src/test/scrips/test-repetition.sh" | ||
# Test eo-parser | ||
bash "${SCRIPT} --max 10 --folder ${GITHUB_WORKSPACE}/eo-parser" | ||
# Test eo-maven-plugin | ||
bash "${SCRIPT} --max 10 --folder ${GITHUB_WORKSPACE}/eo-maven-plugin" | ||
# Test eo-runtime | ||
bash "${SCRIPT} --max 10 --folder ${GITHUB_WORKSPACE}/eo-runtime" | ||
# @todo #2085:90min Add GitHub action step to create an issue. | ||
# It would be convenient to add github action step that will create an | ||
# issue in case of any of the tests is failed. We can do it through | ||
# <a href="https://github.com/JasonEtco/create-an-issue">create-an-issue</a> | ||
# action. Also, you can read about that problem in that discussion: | ||
# <a href="https://github.com/orgs/community/discussions/25111"> | ||
# Create an issue case the workflow fails</a> | ||
|
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,41 @@ | ||
#!/bin/bash | ||
# This script runs the maven tests of the eo component several times | ||
# to check for flaky tests and to find concurrency issues. | ||
# Usage ./test-repetition.sh --max 15 --folder /some/path | ||
|
||
# Initialize variables | ||
max="10" | ||
folder="../eo-runtime" | ||
# Process command-line options | ||
while [[ $# -gt 0 ]]; do | ||
case $1 in | ||
--max) | ||
shift | ||
max=$1 | ||
;; | ||
--folder) | ||
shift | ||
folder=$1 | ||
;; | ||
*) | ||
echo "Invalid option: $1. Please, specify --max or --folder options, for example, --max 15 --folder /some/path" | ||
exit 1 | ||
;; | ||
esac | ||
shift | ||
done | ||
# Print the values of the variables | ||
printf "Number of iterations is %s\n" "$max" | ||
printf "Path to the testable module is %s\n" "$folder" | ||
set -e | ||
# Go to testable folder | ||
cd "$folder" | ||
# Clean the test classes to avoid caching issues and prepare testing environment | ||
# without running the tests | ||
mvn clean install -Pqulice -DskipTests -DskipITs -Dinvoker.skip=true | ||
# Run the tests several times | ||
for (( i=1; i <= max; ++i )) | ||
do | ||
echo "Test repetition #$i of $max" | ||
MAVEN_OPTS=-Dorg.slf4j.simpleLogger.showThreadName=true mvn surefire:test -e | ||
done |