Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity committed Jan 12, 2024
1 parent 899d891 commit 71d31c9
Show file tree
Hide file tree
Showing 19 changed files with 32 additions and 24 deletions.
2 changes: 1 addition & 1 deletion e2e/tests-dfx/assetscanister.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load ../utils/_
setup() {
standard_setup

dfx_new
dfx_new_assets
}

teardown() {
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests-dfx/bitcoin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ set_local_network_bitcoin_enabled() {
}

@test "dfx restarts replica when ic-btc-adapter restarts" {
dfx_new hello
dfx_new_assets hello
dfx_start --enable-bitcoin

install_asset greet
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests-dfx/build_granular.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load ../utils/_
setup() {
standard_setup

dfx_new
dfx_new_assets
}

teardown() {
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests-dfx/canister_http.bash
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ set_shared_local_network_canister_http_empty() {
}

@test "dfx restarts replica when ic-https-outcalls-adapter restarts" {
dfx_new hello
dfx_new_assets hello
dfx_start

install_asset greet
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests-dfx/create.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load ../utils/_
setup() {
standard_setup

dfx_new
dfx_new_assets
}

teardown() {
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests-dfx/deploy.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load ../utils/_
setup() {
standard_setup

dfx_new hello
dfx_new_assets hello
}

teardown() {
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests-dfx/dotenv.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load ../utils/_
setup() {
standard_setup

dfx_new
dfx_new_assets
}

teardown() {
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests-dfx/error_diagnosis.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ teardown() {
assert_command dfx deploy

# simulate previous deploy with CopyPlugin step
cp src/hello_frontend/assets/* dist/hello_frontend/
cp src/hello_frontend/assets/* src/hello_frontend/dist

assert_command_fail dfx deploy
assert_contains "Remove the CopyPlugin step from webpack.config.js"
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests-dfx/identity.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load ../utils/_
setup() {
standard_setup

dfx_new
dfx_new_assets
}

teardown() {
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests-dfx/install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load ../utils/_
setup() {
standard_setup

dfx_new
dfx_new_assets
}

teardown() {
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests-dfx/metadata.bash
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ teardown() {
}

@test "asset canister provides candid:service metadata" {
dfx_new hello
dfx_new_assets hello
dfx_start

assert_command dfx deploy
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests-dfx/mode_reinstall.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load ../utils/_
setup() {
standard_setup

dfx_new hello
dfx_new_assets hello
}

teardown() {
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests-dfx/playground.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load ../utils/_
setup() {
standard_setup
setup_playground
dfx_new hello
dfx_new_assets hello
}

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

@test "dfx restarts icx-proxy" {
dfx_new hello
dfx_new_assets hello
dfx_start

install_asset greet
Expand All @@ -118,7 +118,7 @@ teardown() {
}

@test "dfx restarts icx-proxy when the replica restarts" {
dfx_new hello
dfx_new_assets hello
dfx_start

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

@test "'dfx identity set-wallet --force' bypasses wallet canister verification" {
dfx_new hello
dfx_new_assets hello
dfx_start
setup_actuallylocal_shared_network

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

@test "deploy wallet" {
dfx_new hello
dfx_new_assets hello
dfx_start
setup_actuallylocal_shared_network

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

@test "deploy a canister without dependencies" {
dfx_new hello
dfx_new_assets hello
dfx_start
install_asset greet
assert_command dfx deploy hello_backend
Expand All @@ -32,7 +32,7 @@ teardown() {
}

@test "deploy a canister with dependencies" {
dfx_new hello
dfx_new_assets hello
dfx_start
install_asset greet
assert_command dfx deploy hello_frontend
Expand Down
12 changes: 11 additions & 1 deletion e2e/utils/_.bash
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,17 @@ standard_teardown() {

dfx_new_frontend() {
local project_name=${1:-e2e_project}
dfx new "${project_name}" --frontend
dfx new "${project_name}" --frontend vanilla
test -d "${project_name}"
test -f "${project_name}"/dfx.json
cd "${project_name}"

echo PWD: "$(pwd)" >&2
}

dfx_new_assets() {
local project_name=${1:-e2e_project}
dfx new "${project_name}" --frontend plain-assets
test -d "${project_name}"
test -f "${project_name}"/dfx.json
cd "${project_name}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<body>
<div id="root"></div>
<script type="module" src="main.js"></script>
<script type="module" src="/src/main.js"></script>
</body>

</html>
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import dotenv from 'dotenv';
dotenv.config({ path: '../../.env' });

export default defineConfig({
root: 'src',
build: {
outDir: '../dist',
emptyOutDir: true,
},
optimizeDeps: {
Expand All @@ -26,7 +24,7 @@ export default defineConfig({
},
},
},
publicDir: '../assets',
publicDir: 'assets',
plugins: [
environment('all', { prefix: 'CANISTER_' }),
environment('all', { prefix: 'DFX_' }),
Expand Down

0 comments on commit 71d31c9

Please sign in to comment.