Skip to content

Commit

Permalink
Merge pull request #193 from ldbc/feature/refactor-tests
Browse files Browse the repository at this point in the history
Refactor tests
  • Loading branch information
GLaDAP authored Sep 25, 2022
2 parents d972622 + 6225594 commit 6a81ccd
Show file tree
Hide file tree
Showing 11 changed files with 667 additions and 653 deletions.
25 changes: 22 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,39 @@ orbs:
slack: circleci/[email protected]
workflows:
version: 2
build:
build-then-test:
jobs:
- compile_driver
- test_driver:
requires:
- compile_driver
- test_conversion_script

jobs:
compile_driver:
docker:
- image: cimg/openjdk:11.0.16
steps:
- checkout
- run: mvn clean install -DskipTests

test_driver:
parallelism: 2 # parallel containers to split the tests among
docker:
- image: cimg/openjdk:11.0.16
steps:
- checkout
- run: |
mvn test | tee mvn.log
grep 'BUILD SUCCESS' mvn.log
mvn \
-Dtest=$(for file in $(circleci tests glob "src/test/**/**.java" \
| circleci tests split --split-by=timings); \
do basename $file \
| sed -e "s/.java/,/"; \
done | tr -d '\r\n') \
-e test
- store_test_results: # We use this timing data to optimize the future runs
path: target/surefire-reports

test_conversion_script:
machine:
image: ubuntu-2204:2022.04.1
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,6 @@ public void shouldNotBreakTheMonotonicallyIncreasingScheduledStartTimesOfOperati
flushLog
);

Map<String,String> updateStreamParams = MapUtils.loadPropertiesToMap(
TestUtils.getResource( "/snb/interactive/updateStream.properties" )
);
configuration = (ConsoleAndFileDriverConfiguration) configuration.applyArgs( updateStreamParams );

Workload workload = new LdbcSnbInteractiveWorkload();
workload.init( configuration );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,6 @@ public void shouldRunReadOnlyLdbcWorkloadWithNothingDbAndCrashInSaneManner()
flushLog
);

configuration = (ConsoleAndFileDriverConfiguration) configuration
.applyArgs( MapUtils.loadPropertiesToMap( TestUtils.getResource(
"/snb/interactive/updateStream.properties" ) ) );

controlService = new LocalControlService(
timeSource.nowAsMilli(),
configuration,
Expand Down Expand Up @@ -351,10 +347,6 @@ private void doShouldRunReadOnlyLdbcWorkloadWithNothingDbAndReturnExpectedMetric
flushLog
);

configuration = (ConsoleAndFileDriverConfiguration) configuration
.applyArgs( MapUtils.loadPropertiesToMap( TestUtils.getResource(
"/snb/interactive/updateStream.properties" ) ) );

controlService = new LocalControlService(
timeSource.nowAsMilli(),
configuration,
Expand Down Expand Up @@ -576,10 +568,6 @@ public void doShouldRunReadWriteLdbcWorkloadWithNothingDbAndReturnExpectedMetric
flushLog
);

configuration = (ConsoleAndFileDriverConfiguration) configuration
.applyArgs( MapUtils.loadPropertiesToMap( TestUtils.getResource(
"/snb/interactive/updateStream.properties" ) ) );

controlService = new LocalControlService(
timeSource.nowAsMilli(),
configuration,
Expand Down Expand Up @@ -847,10 +835,6 @@ private void doShouldRunReadOnlyLdbcWorkloadWithNothingDbWhileIgnoringScheduledS
flushLog
);

configuration = (ConsoleAndFileDriverConfiguration) configuration
.applyArgs( MapUtils.loadPropertiesToMap( TestUtils.getResource(
"/snb/interactive/updateStream.properties" ) ) );

controlService = new LocalControlService(
timeSource.nowAsMilli() + 1000,
configuration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ public void shouldFailValidationWhenDbImplementationIsIncorrect()
paramsMap.put( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY,
TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() );
configuration = (ConsoleAndFileDriverConfiguration) configuration.applyArgs( paramsMap );
configuration = (ConsoleAndFileDriverConfiguration) configuration.applyArgs(
MapUtils.loadPropertiesToMap( TestUtils.getResource( "/snb/interactive/updateStream.properties" ) )
);

Workload workload = new LdbcSnbInteractiveWorkload();
workload.init( configuration );
Expand Down Expand Up @@ -113,9 +110,6 @@ public void shouldPassValidationWhenDbImplementationIsCorrect()
paramsMap.put( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY,
TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() );
configuration = (ConsoleAndFileDriverConfiguration) configuration.applyArgs( paramsMap );
configuration = (ConsoleAndFileDriverConfiguration) configuration.applyArgs(
MapUtils.loadPropertiesToMap( TestUtils.getResource( "/snb/interactive/updateStream.properties" ) )
);

Workload workload = new LdbcSnbInteractiveWorkload();
workload.init( configuration );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ public void validationParametersShouldBeUnchangedAfterSerializingAndMarshalling(
paramsMap.put( LdbcSnbInteractiveWorkloadConfiguration.UPDATES_DIRECTORY,
TestUtils.getResource( "/snb/interactive/" ).getAbsolutePath() );
configuration = (ConsoleAndFileDriverConfiguration) configuration.applyArgs( paramsMap );
configuration = (ConsoleAndFileDriverConfiguration) configuration.applyArgs(
MapUtils.loadPropertiesToMap( TestUtils.getResource( "/snb/interactive/updateStream.properties" ) )
);

Workload workload = new LdbcSnbInteractiveWorkload();
workload.init( configuration );
Expand Down
Loading

0 comments on commit 6a81ccd

Please sign in to comment.