Skip to content
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

Document instructions for updating Indexer E2E test input #906

Merged
merged 3 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions misc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Indexer E2E tests

`make e2e` runs tests with input generated by [go-algorand `e2e_subs` tests](https://github.com/algorand/go-algorand/blob/master/test/scripts/e2e_client_runner.py). As of writing `make e2e` is the _only_ automated validation of indexer's consumption of algod output.

The process for updating the `make e2e`'s input is manual. Each time a go-algorand E2E test is modified, the test modifier _must_ generate new artifacts for `make e2e` consumption. Here's the process:

| Step | Command/Action |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Run go-algorand `e2e_subs` tests to produce new Indexer E2E inputs.<br/>* See script comments for local environment setup.<br />* Expect tests to run for ~5-10min. | `bash misc/buildtestdata.sh` |
| Locally confirm Indexer E2E tests pass with new inputs.<br />* _Warning_: Only use these commands locally because they're _not_ secure.<br />* The commands directly invoke `e2elive.py` to increase local iteration speed. `make e2e` spins up a Docker compose environment. | * `docker run -it --rm --name some-postgres -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust -e POSTGRES_USER=$USER -e POSTGRES_DB=indexer_db_e2e postgres` <br/>* `python misc/e2elive.py --source-net $E2EDATA/net_done.tar.bz2 --connection-string "host=localhost port=5432 user=$USER dbname=indexer_db_e2e sslmode=disable"`<br /> * Look for `e2elive.py` output starting with: `indexer e2etest OK`. |
| Upload test run artifacts to S3.<br/>* Publishing to S3 streamlines running the tests for other developers and CI.<br />* Request AWS account in #helpdesk and access key creation permission in #devops. | Run the s3 copy command provided by `misc/buildtestdata.sh` output. |
| Since `make e2e` only runs nightly, validate the next CI run. | * Find the most recent workflow run including jobs prefixed with `nightly_test_with_go`: [https://app.circleci.com/pipelines/github/algorand/indexer?branch=develop&filter=all](https://app.circleci.com/pipelines/github/algorand/indexer?branch=develop&filter=all).<br/>* If successful, confirm the test used the artifact you uploaded. Click a `nightly_test_with_go` job link, expand _make e2e_ and search for `INFO:util:s3://`.<br />* If unsuccessful, investigate source of error. If additional help needed, raise in #indexer. It is _your_ responsibility to ensure the build is fixed. |
michaeldiamant marked this conversation as resolved.
Show resolved Hide resolved
16 changes: 1 addition & 15 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,7 @@ It may be useful to edit one of the entry point scripts to make sure the dataset

When you have setup for an integration test, use the provided `rest_test` / `sql_test` functions to write your tests.

This test loads an e2edata block archive + genesis dataset, you create one using the [buildtestdata.sh](../misc/buildtestdata.sh) script. You need to configure it with where to place the resulting archive, and your go-algorand directory. Here is an example script to setup everything:
```bash
#!/usr/bin/env bash

rm -rf ve3
export GOALGORAND="${GOPATH}/src/github.com/algorand/go-algorand"
export E2EDATA="${HOME}/algorand/indexer/e2edata"
export BUILD_BLOCK_ARCHIVE="yes please"
rm -rf "$E2EDATA"
mkdir -p "$E2EDATA"
python3 -m venv ve3
ve3/bin/pip install py-algorand-sdk
. ve3/bin/activate
./misc/buildtestdata.sh
```
This test loads an e2edata block archive + genesis dataset, you create one using the [buildtestdata.sh](../misc/buildtestdata.sh) script. See top-level comments in [buildtestdata.sh](../misc/buildtestdata.sh) for local environment setup instructions.

The archive will be buried in the `E2EDATA` directory somewhere. That file is passed to start_indexer_with_blocks, then you just need to write the tests.

Expand Down