Skip to content

Commit

Permalink
docs: e2e README
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszjasiuk committed Jul 17, 2023
1 parent dbf36dc commit 614c967
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 37 deletions.
37 changes: 37 additions & 0 deletions e2e/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# @anoma/e2e
Package containing extension and web interface e2e tests.

## Development
- run `yarn setup` which builds extension and web interface with `--watch` flag
- wait for setup to finish
- run `yarn test` or `yarn test:watch`

## CI
- WIP :)

## Other stuff
- **So far only downloads namada linux binaries**
- **So far only works for namada 0.19** - you can change version in `./setup-namada.sh`
- **So far downloads MASP params every time we load extension**
- **Namada binaries, wasm checksums and wasms are cached** - they will dl again only if namada version changes

### Helper scripts
`./setup-frontend.sh`
- builds extension and web interface with `--watch` flag
`./setup-namada.sh`
- if needed downloads namada binaries, wasm checksums.json file and wasm files from s3
- initializes the chain
- reads chain id of the initialized chain, copies wasm files and replaces chain id in built extension and web interface files[^1]
`./start-namada.sh`
- starts namada with the current chain id

### Writing tests
If you wrtie a test that needs namada running you have to consider few things:
- you need to setup namada **before** puppeteer loads the extension. Otherwise there would be a chain id mismatch and things like transfers will not work.
- you need to be sure that there is only one test using namada running at the same time. The reason is the same as above. This is something that can change in future. We need to figure out how many instances of namada we want to run at the same time.
- make sure that you stop namada process after test(s) are done

You can use predefined values in `utils/values` and addresses defined in `genesis.toml` for quicker test setup.


[^1]: We do this so we do not have to rebuild extension/web interface every time we reinitialize the chain. Unfortunately we can not force namada to initialize with the same chain id all the time.
17 changes: 0 additions & 17 deletions e2e/dl-wasms.sh

This file was deleted.

6 changes: 3 additions & 3 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
"lint": "npx eslint src --ext .ts",
"lint:fix": "yarn lint -- --fix",
"lint:ci": "yarn lint --max-warnings 0",
"setup": "/setup-frontend.sh",
"setup": "./setup-frontend.sh",
"test": "jest --runInBand",
"test:watch": "jest --watch --runInBand",
"e2e": "start-server-and-test setup http://localhost:3000 test"
"test:watch": "jest --watch --runInBand"
},
"dependencies": {
"typescript": "^5.1.3"
Expand All @@ -31,6 +30,7 @@
"jest": "^29.0.2",
"jest-puppeteer": "^9.0.0",
"puppeteer": "^20.8.2",
"start-server-and-test": "^2.0.0",
"terminate": "^2.6.1"
}
}
63 changes: 46 additions & 17 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6273,6 +6273,11 @@ arg@^5.0.1:
resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.1.tgz#eb0c9a8f77786cad2af8ff2b862899842d7b6adb"
integrity sha512-e0hDa9H2Z9AwFkk2qDlwhoMYE4eToKarchkQHovNdLTCYMHZHeRjI71crOh+dio4K6u1IcwubQqo79Ga4CyAQA==

arg@^5.0.2:
version "5.0.2"
resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.2.tgz#c81433cc427c92c4dcf4865142dbca6f15acd59c"
integrity sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==

argparse@^1.0.7:
version "1.0.10"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
Expand Down Expand Up @@ -6867,7 +6872,7 @@ bip39@^3.0.2:
pbkdf2 "^3.0.9"
randombytes "^2.0.1"

bluebird@^3.5.1, bluebird@^3.5.5:
bluebird@3.7.2, bluebird@^3.5.1, bluebird@^3.5.5:
version "3.7.2"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==
Expand Down Expand Up @@ -7251,6 +7256,11 @@ charenc@~0.0.1:
resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667"
integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==

[email protected]:
version "2.24.0"
resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600"
integrity sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==

check-types@^11.1.1:
version "11.1.2"
resolved "https://registry.yarnpkg.com/check-types/-/check-types-11.1.2.tgz#86a7c12bf5539f6324eb0e70ca8896c0e38f3e2f"
Expand Down Expand Up @@ -9318,20 +9328,7 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3:
md5.js "^1.3.4"
safe-buffer "^5.1.1"

execa@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8"
integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==
dependencies:
cross-spawn "^6.0.0"
get-stream "^4.0.0"
is-stream "^1.1.0"
npm-run-path "^2.0.0"
p-finally "^1.0.0"
signal-exit "^3.0.0"
strip-eof "^1.0.0"

execa@^5.0.0:
[email protected], execa@^5.0.0:
version "5.1.1"
resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd"
integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==
Expand All @@ -9346,6 +9343,19 @@ execa@^5.0.0:
signal-exit "^3.0.3"
strip-final-newline "^2.0.0"

execa@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8"
integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==
dependencies:
cross-spawn "^6.0.0"
get-stream "^4.0.0"
is-stream "^1.1.0"
npm-run-path "^2.0.0"
p-finally "^1.0.0"
signal-exit "^3.0.0"
strip-eof "^1.0.0"

exenv@^1.2.0:
version "1.2.2"
resolved "https://registry.yarnpkg.com/exenv/-/exenv-1.2.2.tgz#2ae78e85d9894158670b03d47bec1f03bd91bb9d"
Expand Down Expand Up @@ -13522,6 +13532,11 @@ language-tags@^1.0.5:
dependencies:
language-subtag-registry "~0.3.2"

[email protected]:
version "1.6.0"
resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513"
integrity sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==

leb128@^0.0.5:
version "0.0.5"
resolved "https://registry.yarnpkg.com/leb128/-/leb128-0.0.5.tgz#84524a86ef7799fb3933ce41345f6490e27ac948"
Expand Down Expand Up @@ -15313,7 +15328,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==

ps-tree@^1.2.0:
ps-tree@1.2.0, ps-tree@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.2.0.tgz#5e7425b89508736cdd4f2224d028f7bb3f722ebd"
integrity sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==
Expand Down Expand Up @@ -16662,6 +16677,20 @@ stackframe@^1.1.1:
resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.2.1.tgz#1033a3473ee67f08e2f2fc8eba6aef4f845124e1"
integrity sha512-h88QkzREN/hy8eRdyNhhsO7RSJ5oyTqxxmmn0dzBIMUclZsjpfmrsg81vp8mjjAs2vAZ72nyWxRUwSwmh0e4xg==

start-server-and-test@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/start-server-and-test/-/start-server-and-test-2.0.0.tgz#0644809d63036a8a001efb70582f3e37ebfdd33d"
integrity sha512-UqKLw0mJbfrsG1jcRLTUlvuRi9sjNuUiDOLI42r7R5fA9dsFoywAy9DoLXNYys9B886E4RCKb+qM1Gzu96h7DQ==
dependencies:
arg "^5.0.2"
bluebird "3.7.2"
check-more-types "2.24.0"
debug "4.3.4"
execa "5.1.1"
lazy-ass "1.6.0"
ps-tree "1.2.0"
wait-on "7.0.1"

[email protected]:
version "2.0.1"
resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63"
Expand Down Expand Up @@ -17699,7 +17728,7 @@ w3c-xmlserializer@^3.0.0:
dependencies:
xml-name-validator "^4.0.0"

wait-on@^7.0.1:
wait-on@7.0.1, wait-on@^7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/wait-on/-/wait-on-7.0.1.tgz#5cff9f8427e94f4deacbc2762e6b0a489b19eae9"
integrity sha512-9AnJE9qTjRQOlTZIldAaf/da2eW0eSRSgcqq85mXQja/DW3MriHxkpODDSUEg+Gri/rKEcXUZHe+cevvYItaog==
Expand Down

0 comments on commit 614c967

Please sign in to comment.