-
Notifications
You must be signed in to change notification settings - Fork 40
Use Cosmos DB emulator for the integration tests #1909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
.github/workflows/ci.yaml
Outdated
| # Delete all files modified more than 3 days ago with the ".out.log" file extension located in the "/home/azureuser/.gradle/daemon" | ||
| # folder hierarchy. These files accumulate over time and can end up using a lot of disk space | ||
| run : find /home/azureuser/.gradle/daemon -name "*.out.log" -type f -mtime +3 -exec rm -vf {} + | ||
| arguments: integrationTestCosmos -PjavaVersion=${{ env.JAVA_VERSION }} -PjavaVendor=${{ env.JAVA_VENDOR }} -PintegrationTestJavaRuntimeVersion=${{ env.INT_TEST_JAVA_RUNTIME_VERSION }} -PintegrationTestJavaRuntimeVendor=${{ env.INT_TEST_JAVA_RUNTIME_VENDOR }} -Dscalardb.cosmos.uri=https://localhost:8081/ -Dscalardb.cosmos.password=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw== -Dscalardb.cosmos.database_prefix=${{ env.db_prefix }}_ -Dfile.encoding=UTF-8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This password is a public value, so hard coded here.
-Dfile.encoding=UTF-8 is needed to address some encoding issues that occur due to the WM's default charset (Windows-1252)
| options { | ||
| systemProperties(System.getProperties().findAll{it.key.toString().startsWith("scalardb")}) | ||
| } | ||
| maxParallelForks = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concurrent operations seem to increase the possibility of tentative errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, okay. How long does this integration test take? Is it shorter than before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brfrn169 About 26 minutes.

The test once passed with maxParallelForks = 3 and took 19 minutes. But the test often failed with the configuration...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay... Thank you. I wish it had solved the slow integration test problem as well. 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using larger runners might make parallel execution feasible. It should be way more inexpensive than Cosmos DB, so it is worth trying. Let's discuss it later.
.github/workflows/ci.yaml
Outdated
| - name: Generate unique prefix using the epoch | ||
| run: | | ||
| echo "db_prefix=$(date +%s%3N)" >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this since multiple integration test runners are not sharing the same CosmosDB instance now; there won't be database name conflicts without a prefix.
I guess we could also remove the handling of the scalardb.cosmos.database_prefix environment variable in the integration test code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Torch3333 Good catch! Thank you. I'll remove db_prefix related jobs and parameters from the workflow file.
For Java code, I think we may want to test with real Cosmo DB later. The implementation handling scalardb.cosmos.database_prefix might be useful for such a case. I don't have a strong opinion on it, though. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Ok, keeping the implementation handling is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@komamitsu @Torch3333 I think we can remove scalardb.cosmos.database_prefix. This parameter is useful only when using a shared Cosmos DB account. If we want to test with real Cosmos DB later, we can create a new dedicated Cosmos DB account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brfrn169 Thanks. Understood. I'll create a follow up PR for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@komamitsu Thank you!
Torch3333
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you.
brfrn169
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than what I commented. Thank you!
feeblefakie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
| options { | ||
| systemProperties(System.getProperties().findAll{it.key.toString().startsWith("scalardb")}) | ||
| } | ||
| maxParallelForks = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using larger runners might make parallel execution feasible. It should be way more inexpensive than Cosmos DB, so it is worth trying. Let's discuss it later.
Description
Recent Cosmos DB integration tests are slow and unstable. We also need to manage Cosmos DB related resources for the integration tests. This PR uses the Azure Cosmos DB emulator instead using actual Cosmos DB.
Related issues and/or PRs
None
Changes made
windows-latestimageChecklist
Additional notes (optional)
None
Release notes
N/A