-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Migrate integration tests for spring-data-cosmosdb #12609
Merged
kushagraThapar
merged 17 commits into
Azure:master
from
yiliuTo:feature/migrate-spring-data-cosmos-IT
Jul 7, 2020
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
359fc04
add spring cosmosdb IT to sdk\cosmos tests.yml
yiliuTo 6b59bf4
add test-resources.json for IT
yiliuTo 58d12f4
add default constructor for IT
yiliuTo 114adfb
modify javadoc and code owners
yiliuTo 19e9242
add tests.yml in azure-spring-data-cosmosdb
yiliuTo fd2f97c
modify readme.md for outdated link
yiliuTo 2190b09
place integration test files in sdk/cosmos and rename directory path
yiliuTo 2512f38
modify javadoc warning of @ symbol for the pipeline
yiliuTo b4a7f46
revert eng files and modify test-resources.json for IT
yiliuTo c3393f5
Added spring integration matrix tests for Session and Strong consistency
kushagraThapar bb430f2
Enabled unit tests and integration tests for azure and emulator
kushagraThapar e687403
Added account host and key to emulator tests
kushagraThapar 8a4b0fb
Reverted experimental changes. Exculded PageablePersonRepositoryIT fr…
kushagraThapar da7e7bb
restore file generate_overview_from_readme.py
yiliuTo b4c694f
clear reademe.md temparorily for pipeline
yiliuTo 40a3e2a
add Contributing.md
yiliuTo a952b45
modify version declaration in contributing.md
yiliuTo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Validating CODEOWNERS rules …
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
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 |
---|---|---|
|
@@ -68,3 +68,4 @@ package-lock.json | |
# VS Code | ||
.vscode/ | ||
.factorypath | ||
jacoco.exec |
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
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,62 @@ | ||
# Contributing | ||
This instruction is guideline for building and code contribution. | ||
|
||
## Prequisites | ||
- JDK 1.8 and above | ||
- [Maven](http://maven.apache.org/) 3.0 and above | ||
|
||
## Build from source | ||
To build the project, run maven commands. | ||
|
||
```bash | ||
git clone https://github.com/Azure/azure-sdk-for-java.git | ||
cd sdk/cosmos/azure-spring-data-cosmosdb | ||
mvnw clean install | ||
``` | ||
|
||
## Test | ||
There're integration tests on azure and on emulator to trigger integration test execution against Azure Cosmos DB and against [Azure Cosmos DB Emulator](https://docs.microsoft.com/azure/cosmos-db/local-emulator), you need to follow the link to setup emulator before test execution. | ||
|
||
- Run unit tests | ||
```bash | ||
mvnw clean install | ||
``` | ||
|
||
- Run integration tests | ||
- on Azure | ||
>**NOTE** Please note that integration test against Azure requires Azure Cosmos DB Document API and will automatically create a Cosmos database in your Azure subscription, then there will be **Azure usage fee.** | ||
|
||
Integration tests will require a Azure Subscription. If you don't already have an Azure subscription, you can activate your [MSDN subscriber benefits](https://azure.microsoft.com/pricing/member-offers/msdn-benefits-details/) or sign up for a [free Azure account](https://azure.microsoft.com/free/). | ||
|
||
1. Create an Azure Cosmos DB on Azure. | ||
- Go to [Azure portal](https://portal.azure.com/) and click +New. | ||
- Click Databases, and then click Azure Cosmos DB to create your database. | ||
- Navigate to the database you have created, and click Access keys and copy your URI and access keys for your database. | ||
|
||
2. Set environment variables ACCOUNT_HOST, ACCOUNT_KEY and SECONDARY_ACCOUNT_KEY, where value of them are Cosmos account URI, primary key and secondary key. | ||
3. Run maven command with `integration-test-azure` profile. | ||
|
||
```bash | ||
set ACCOUNT_HOST=your-cosmos-account-uri | ||
set ACCOUNT_KEY=your-cosmos-account-primary-key | ||
set SECONDARY_ACCOUNT_KEY=your-cosmos-account-secondary-key | ||
mvnw -P integration-test-azure clean install | ||
``` | ||
- on Emulator | ||
|
||
Setup Azure Cosmos DB Emulator by following [this instruction](https://docs.microsoft.com/azure/cosmos-db/local-emulator), and set associated environment variables. Then run test with: | ||
```bash | ||
mvnw -P integration-test-emulator install | ||
``` | ||
|
||
|
||
- Skip tests execution | ||
```bash | ||
mvnw clean install -DskipTests | ||
``` | ||
|
||
## Version management | ||
Developing version naming convention is like `0.1.2-beta.1`. Release version naming convention is like `0.1.2`. | ||
|
||
## Contribute to code | ||
Contribution is welcome. Please follow [this instruction](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md) to contribute code. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Are there any security concerns here? Is this secret used anywhere else, can it be randomly generated?
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.
No security concerns : this key is documented in public Microsoft docs : https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator#authenticating-requests
Also in azure-cosmos source code: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/TestConfigurations.java#L42