Skip to content

Commit

Permalink
rm irrelevant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sesi200 committed Feb 13, 2024
1 parent 0c9bae4 commit 4fe5bd7
Showing 1 changed file with 0 additions and 88 deletions.
88 changes: 0 additions & 88 deletions extensions/nns/e2e/tests/nns.bash
Original file line number Diff line number Diff line change
Expand Up @@ -162,91 +162,3 @@ assert_nns_canister_id_matches() {
assert_output --partial "Canister um5iw-rqaaa-aaaaq-qaaba-cai not found"
}

test_project_import() {
DFX_JSON_LOCATION="$1"

# this test is meant to demonstrate that the various
dfx beta project import "$DFX_JSON_LOCATION" --prefix "pfx-" --network-mapping ic=mainnet --all

jq . dfx.json

run jq -r '.canisters."pfx-normal-canister".candid' dfx.json
assert_success
assert_output "candid/pfx-normal-canister.did"
# shellcheck disable=SC2154
assert_files_eq \
"${assets}/project-import/project-directory/normal-canister-directory/some-subdirectory/the-candid-filename.did" \
"candid/pfx-normal-canister.did"

run jq -r '.canisters."pfx-normal-canister".remote.id.ic' dfx.json
assert_success
assert_output "rrkah-fqaaa-aaaaa-aaaaq-cai"

run jq -r '.canisters."pfx-sibling".candid' dfx.json
assert_success
assert_output "candid/pfx-sibling.did"
assert_files_eq \
"${assets}/project-import/sibling-project/canister/canister/the-sibling-candid-definition.did" \
"candid/pfx-sibling.did"
}

@test "dfx project import from filesystem" {
test_project_import "${assets}/project-import/project-directory/dfx.json"
}

@test "dfx project import from url" {
start_webserver --directory "${assets}/project-import"

test_project_import "http://localhost:$E2E_WEB_SERVER_PORT/project-directory/dfx.json"
}

test_project_import_specific_canister() {
LOCATION="$1"

# this test is meant to demonstrate that the various
dfx beta project import "$LOCATION" normal-canister

jq . dfx.json

run jq -r '.canisters."normal-canister".candid' dfx.json
assert_success
assert_output "candid/normal-canister.did"
assert_files_eq \
"${assets}/project-import/project-directory/normal-canister-directory/some-subdirectory/the-candid-filename.did" \
"candid/normal-canister.did"

run jq -r '.canisters.sibling.candid' dfx.json
assert_success
assert_output "null"
}

@test "dfx project import specific canister" {
test_project_import_specific_canister "${assets}/project-import/project-directory/dfx.json"
}

@test "import from url" {
start_webserver --directory "${assets}/project-import"

test_project_import_specific_canister "http://localhost:$E2E_WEB_SERVER_PORT/project-directory/dfx.json"
}

@test "project import from filesystem with no canister_ids.json" {
mkdir www
cp -R "${assets}/project-import" www/
rm www/project-import/project-directory/canister_ids.json

start_webserver --directory "www/project-import"

dfx beta project import www/project-import/project-directory/dfx.json --all
}

@test "project import from url with no canister_ids.json" {
mkdir www
cp -R "${assets}/project-import" www/
rm www/project-import/project-directory/canister_ids.json

start_webserver --directory "www/project-import"

dfx beta project import "http://localhost:$E2E_WEB_SERVER_PORT/project-directory/dfx.json" --all
}

0 comments on commit 4fe5bd7

Please sign in to comment.