Skip to content

Commit

Permalink
feat: enable more pocketic features (#3895)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity authored Sep 17, 2024
1 parent 3e87576 commit babc9db
Show file tree
Hide file tree
Showing 21 changed files with 264 additions and 219 deletions.
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,40 @@

# UNRELEASED

### feat: More PocketIC flags supported

`dfx start --pocketic` is now compatible with `--artificial-delay` and the `subnet_type` configuration option, and enables `--enable-canister-http` by default.

## Dependencies

### Replica

Updated replica to elected commit 179973553248415fc85679d853b48b0e0ec231c6.

This incorporates the following elected proposals:

- [132507](https://dashboard.internetcomputer.org/proposal/132507)
- [132482](https://dashboard.internetcomputer.org/proposal/132482)
- [132481](https://dashboard.internetcomputer.org/proposal/132481)
- [132500](https://dashboard.internetcomputer.org/proposal/132500)
- [132416](https://dashboard.internetcomputer.org/proposal/132416)
- [132413](https://dashboard.internetcomputer.org/proposal/132413)
- [132414](https://dashboard.internetcomputer.org/proposal/132414)
- [132412](https://dashboard.internetcomputer.org/proposal/132412)
- [132376](https://dashboard.internetcomputer.org/proposal/132376)
- [132375](https://dashboard.internetcomputer.org/proposal/132375)
- [132223](https://dashboard.internetcomputer.org/proposal/132223)
- [132222](https://dashboard.internetcomputer.org/proposal/132222)
- [132149](https://dashboard.internetcomputer.org/proposal/132149)
- [132148](https://dashboard.internetcomputer.org/proposal/132148)
- [131787](https://dashboard.internetcomputer.org/proposal/131787)
- [131757](https://dashboard.internetcomputer.org/proposal/131757)
- [131697](https://dashboard.internetcomputer.org/proposal/131697)

### Candid UI

Module hash 15da2adc4426b8037c9e716b81cb6a8cf1a835ac37589be2cef8cb3f4a04adaa

# 0.24.0

### fix: bumps sveltekit starter dependency versions to prevent typescript config error
Expand Down
7 changes: 4 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions e2e/tests-dfx/assetscanister.bash
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ check_permission_failure() {

# fails with because %e6 is not valid utf-8 percent encoding
assert_command_fail curl --fail -vv http://localhost:"$PORT"/%e6?canisterId="$ID"
assert_contains "400 Bad Request"
assert_contains "500 Internal Server Error"
}

@test "http_request percent-decodes urls" {
Expand Down Expand Up @@ -788,7 +788,7 @@ check_permission_failure() {

assert_command_fail curl --fail -vv http://localhost:"$PORT"/%e6?canisterId="$ID"
# fails because %e6 is not valid utf-8 percent encoding
assert_contains "400 Bad Request"
assert_contains "500 Internal Server Error"

assert_command curl --fail -vv http://localhost:"$PORT"/%25?canisterId="$ID"
assert_match "200 OK" "$stderr"
Expand Down
13 changes: 13 additions & 0 deletions e2e/tests-dfx/canister_extra.bash
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,17 @@ teardown() {

assert_command_fail dfx canister snapshot create hello_backend
assert_contains 'Canister hello_backend is running and snapshots should not be taken of running canisters'
}

@test "can query a website" {
dfx_start

dfx_new
install_asset canister_http

dfx deploy

assert_command dfx canister call e2e_project_backend get_url '("www.githubstatus.com:443","https://www.githubstatus.com:443")'
assert_contains "Git Operations"
assert_contains "API Requests"
}
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,3 @@ set_shared_local_network_canister_http_empty() {
assert_command dfx start --background --verbose
assert_match "log level: Critical"
}

@test "can query a website" {
dfx_start

dfx_new
install_asset canister_http

dfx deploy

assert_command dfx canister call e2e_project_backend get_url '("www.githubstatus.com:443","https://www.githubstatus.com:443")'
assert_contains "Git Operations"
assert_contains "API Requests"
}
2 changes: 1 addition & 1 deletion e2e/tests-dfx/create.bash
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ teardown() {
assert_contains 'Memory allocation: 0'
assert_contains 'Compute allocation: 0'
assert_contains 'Reserved cycles limit: 5_000_000_000_000'
assert_contains 'Wasm memory limit: 0'
assert_contains 'Wasm memory limit: 3_221_225_472'
assert_contains 'Freezing threshold: 2_592_000'
assert_contains 'Log visibility: controllers'
}
2 changes: 1 addition & 1 deletion e2e/tests-dfx/cycles-ledger.bash
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ teardown() {
start_and_install_nns() {
dfx_start_for_nns_install

dfx extension install nns --version 0.3.1
dfx extension install nns --version 0.4.3
dfx nns install --ledger-accounts "$(dfx ledger account-id --identity cycle-giver)"
}

Expand Down
2 changes: 0 additions & 2 deletions e2e/tests-dfx/shared_local_network.bash
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ teardown() {
}

@test "project data is cleared after dfx start --clean from outside the project" {
[[ "$USE_POCKETIC" ]] && skip "dfx_start does not support parameters with pocketic"
mkdir somewhere
(
cd somewhere
Expand Down Expand Up @@ -94,7 +93,6 @@ teardown() {


@test "wallet config file is reset after start --clean" {
[[ "$USE_POCKETIC" ]] && skip "dfx_start does not support parameters with pocketic"
dfx_start

(
Expand Down
6 changes: 2 additions & 4 deletions e2e/tests-dfx/start.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ teardown() {
}

@test "start and stop with different options" {
[[ "$USE_POCKETIC" ]] && skip "skipped for pocketic: artificial delay, and clean required"
[[ "$USE_POCKETIC" ]] && skip "skipped for pocketic: clean required"
dfx_start --artificial-delay 101
dfx_stop

Expand All @@ -32,7 +32,6 @@ teardown() {
}

@test "project networks still need --clean" {
[[ "$USE_POCKETIC" ]] && skip "skipped for pocketic: artificial delay"
dfx_new hello
define_project_network

Expand All @@ -43,7 +42,7 @@ teardown() {
}

@test "stop and start with other options does not disrupt projects" {
[[ "$USE_POCKETIC" ]] && skip "skipped for pocketic: artificial delay"
[[ "$USE_POCKETIC" ]] && skip "skipped for pocketic: clean required"
dfx_start --artificial-delay 101

dfx_new p1
Expand Down Expand Up @@ -487,7 +486,6 @@ teardown() {
}

@test "flags count as configuration modification and require --clean for a project network" {
[[ "$USE_POCKETIC" ]] && skip "skipped for pocketic: --artificial-delay"
dfx_new
define_project_network

Expand Down
3 changes: 1 addition & 2 deletions e2e/utils/_.bash
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,8 @@ dfx_start() {
add_default_parameter "--host" "127.0.0.1:0"
if [[ "$USE_POCKETIC" ]]; then
add_default_parameter "--pocketic"
else
add_default_parameter "--artificial-delay" "100"
fi
add_default_parameter "--artificial-delay" "100"

determine_network_directory

Expand Down
Loading

0 comments on commit babc9db

Please sign in to comment.