Skip to content

Commit

Permalink
Merge pull request objectionary#2086 from volodya-lombrozo/highload_test
Browse files Browse the repository at this point in the history
test(objectionary#2085): Test repetition at night
  • Loading branch information
yegor256 authored May 26, 2023
2 parents dd794a2 + 74b7184 commit 4112dcf
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/daily.yml
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>

41 changes: 41 additions & 0 deletions src/test/scripts/test-repetition.sh
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

0 comments on commit 4112dcf

Please sign in to comment.