-
Notifications
You must be signed in to change notification settings - Fork 70
Enhancement: Use Sandbox for Testing #363
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
cc9d96f
try it all out on circle
abe612d
Update test-harness.sh
tzaffi 7216d3f
missing dbl quote
68846c6
Update .test-env
tzaffi 73d0c03
verbose_harness=0
382bb76
remove EvalDelta & Indexer steps + don't use indexer v1
ce7c8af
un-reformat
4ec4364
quotes
e750f95
oops - need to include the tag files
b61d485
Merge remote-tracking branch 'origin' into sandbox-sdk-testing
97e9ecd
Update Makefile
tzaffi 93dbee4
Merge branch 'sandbox-sdk-testing' of github.com:algorand/java-algora…
6b68325
following fuzzy matcher - remove 3 step definitions
e1a7668
guard the find regex
58e4279
removing Unused Steps Analysis Unused Steps
0ef0c20
lintings
41f1436
add a note about standing up test harness without make docker-test
bffb5c9
Update .test-env
tzaffi 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
This file contains hidden or 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,14 @@ | ||
| # Configs for testing repo download: | ||
| SDK_TESTING_URL="https://github.com/algorand/algorand-sdk-testing" | ||
| SDK_TESTING_BRANCH="trim-indexer" | ||
| SDK_TESTING_HARNESS="test-harness" | ||
|
tzaffi marked this conversation as resolved.
Outdated
|
||
|
|
||
| VERBOSE_HARNESS=1 | ||
|
|
||
| # WARNING: If set to 1, new features will be LOST when downloading the test harness. | ||
| # REGARDLESS: modified features are ALWAYS overwritten. | ||
| REMOVE_LOCAL_FEATURES=0 | ||
|
|
||
| # WARNING: Be careful when turning on the next variable. | ||
| # In that case you'll need to provide all variables expected by `algorand-sdk-testing`'s `.env` | ||
| OVERWRITE_TESTING_ENVIRONMENT=0 | ||
|
tzaffi marked this conversation as resolved.
Outdated
|
||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,10 +1,20 @@ | ||
| UNITS = "@unit.offline or @unit.algod or @unit.indexer or @unit.rekey or @unit.indexer.rekey or @unit.transactions or @unit.transactions.keyreg or @unit.responses or @unit.applications or @unit.dryrun or @unit.tealsign or @unit.responses.messagepack or @unit.responses.231 or @unit.responses.messagepack.231 or @unit.feetest or @unit.indexer.logs or @unit.abijson or @unit.abijson.byname or @unit.atomic_transaction_composer or @unit.transactions.payment or @unit.responses.unlimited_assets or @unit.algod.ledger_refactoring or @unit.indexer.ledger_refactoring or @unit.dryrun.trace.application or @unit.sourcemap" | ||
| unit: | ||
| mvn test -Dcucumber.filter.tags="@unit.offline or @unit.algod or @unit.indexer or @unit.rekey or @unit.indexer.rekey or @unit.transactions or @unit.transactions.keyreg or @unit.responses or @unit.applications or @unit.dryrun or @unit.tealsign or @unit.responses.messagepack or @unit.responses.231 or @unit.responses.messagepack.231 or @unit.feetest or @unit.indexer.logs or @unit.abijson or @unit.abijson.byname or @unit.atomic_transaction_composer or @unit.transactions.payment or @unit.responses.unlimited_assets or @unit.algod.ledger_refactoring or @unit.indexer.ledger_refactoring or @unit.dryrun.trace.application or @unit.sourcemap" | ||
| mvn test -Dcucumber.filter.tags=$(UNITS) | ||
|
|
||
| INTEGRATIONS = "@algod or @assets or @auction or @kmd or @send or @send.keyregtxn or @indexer or @rekey_v1 or @applications.verified or @applications or @compile or @dryrun or @indexer.applications or @indexer.231 or @abi or @c2c or @compile.sourcemap" | ||
|
tzaffi marked this conversation as resolved.
Outdated
|
||
| integration: | ||
| mvn test \ | ||
| -Dtest=com.algorand.algosdk.integration.RunCucumberIntegrationTest \ | ||
| -Dcucumber.filter.tags="@algod or @assets or @auction or @kmd or @send or @send.keyregtxn or @indexer or @rekey_v1 or @applications.verified or @applications or @compile or @dryrun or @indexer.applications or @indexer.231 or @abi or @c2c or @compile.sourcemap" | ||
| mvn test -Dtest=com.algorand.algosdk.integration.RunCucumberIntegrationTest -Dcucumber.filter.tags=$(INTEGRATIONS) | ||
|
|
||
| docker-test: | ||
| ./run_integration_tests.sh | ||
| harness: | ||
| ./test-harness.sh | ||
|
|
||
| docker-javasdk-build: | ||
| # Build SDK testing environment | ||
| docker build -t java-sdk-testing . | ||
|
|
||
| docker-javasdk-run: | ||
| # Launch SDK testing | ||
| docker run -it --network host java-sdk-testing:latest | ||
|
|
||
| docker-test: harness docker-javasdk-build docker-javasdk-run | ||
|
Comment on lines
+13
to
+24
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Breaking up
|
||
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,73 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| START=$(date "+%s") | ||
|
|
||
| THIS=$(basename "$0") | ||
| ENV_FILE=".test-env" | ||
| TEST_DIR="src/test/resources/com/algorand/algosdk" | ||
| TEST_RESOURCES_DIR="src/test/resources/" | ||
|
|
||
| set -a | ||
| source "$ENV_FILE" | ||
| set +a | ||
|
|
||
| rootdir=$(dirname "$0") | ||
| pushd "$rootdir" | ||
|
|
||
| ## Reset test harness | ||
| if [ -d "$SDK_TESTING_HARNESS" ]; then | ||
| pushd "$SDK_TESTING_HARNESS" | ||
| ./scripts/down.sh | ||
| popd | ||
| rm -rf "$SDK_TESTING_HARNESS" | ||
| else | ||
| echo "$THIS: directory $SDK_TESTING_HARNESS does not exist - NOOP" | ||
| fi | ||
|
|
||
| git clone --depth 1 --single-branch --branch "$SDK_TESTING_BRANCH" "$SDK_TESTING_URL" "$SDK_TESTING_HARNESS" | ||
|
|
||
|
|
||
| if [[ $OVERWRITE_TESTING_ENVIRONMENT == 1 ]]; then | ||
| echo "$THIS: OVERWRITE replaced $SDK_TESTING_HARNESS/.env with $ENV_FILE:" | ||
| cp "$ENV_FILE" "$SDK_TESTING_HARNESS"/.env | ||
| fi | ||
|
|
||
| ## Copy feature files into the project resources | ||
| if [[ $REMOVE_LOCAL_FEATURES == 1 ]]; then | ||
| echo "$THIS: OVERWRITE wipes clean $TEST_DIR/features" | ||
| if [[ $VERBOSE_HARNESS == 1 ]]; then | ||
| ( tree $TEST_DIR/integration && tree $TEST_DIR/unit && tree $TEST_RESOURCES_DIR && echo "$THIS: see the previous for files deleted" ) || true | ||
| fi | ||
| rm -rf $TEST_DIR/integration | ||
| rm -rf $TEST_DIR/unit | ||
| rm -rf $TEST_RESOURCES_DIR | ||
| fi | ||
| mkdir -p $TEST_DIR/integration | ||
| mkdir -p $TEST_DIR/unit | ||
| mkdir -p $TEST_RESOURCES_DIR | ||
|
|
||
| # The Java implementation of these is too tightly coupled with the | ||
| # integration tests, so add them to the integration tests instead. | ||
| mv "$SDK_TESTING_HARNESS"/features/unit/offline.feature test-harness/features/integration/ | ||
|
tzaffi marked this conversation as resolved.
Outdated
|
||
|
|
||
| cp -r "$SDK_TESTING_HARNESS"/features/integration/* $TEST_DIR/integration | ||
| cp -r "$SDK_TESTING_HARNESS"/features/unit/* $TEST_DIR/unit | ||
| cp -r "$SDK_TESTING_HARNESS"/features/resources/* $TEST_RESOURCES_DIR | ||
|
|
||
| if [[ $VERBOSE_HARNESS == 1 ]]; then | ||
| ( tree $TEST_DIR/integration && tree $TEST_DIR/unit && tree $TEST_RESOURCES_DIR && echo "$THIS: see the previous for files copied over" ) || true | ||
| fi | ||
| echo "$THIS: seconds it took to get to end of cloning and copying: $(($(date "+%s") - START))s" | ||
|
|
||
| ## Start test harness environment | ||
| pushd "$SDK_TESTING_HARNESS" | ||
| ./scripts/up.sh | ||
| popd | ||
| echo "$THIS: seconds it took to finish testing sdk's up.sh: $(($(date "+%s") - START))s" | ||
| echo "" | ||
| echo "--------------------------------------------------------------------------------" | ||
| echo "|" | ||
| echo "| To run sandbox commands, cd into $SDK_TESTING_HARNESS/.sandbox " | ||
| echo "|" | ||
| echo "--------------------------------------------------------------------------------" | ||
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.
Uh oh!
There was an error while loading. Please reload this page.