Skip to content

Commit

Permalink
chore(upgrade-test): rename upgrade and remove unneeded actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mhofman committed Dec 1, 2023
1 parent 080f5d4 commit e00e2c9
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 123 deletions.
21 changes: 7 additions & 14 deletions packages/deployment/upgrade-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
# Defaults
ARG BASE_IMAGE=ghcr.io/agoric/agoric-3-proposals@sha256:ac10c09b5927d759d37b1525b5a0bc4aeb3034df8d0f0fbb15b51203555ffb1b
ARG BASE_IMAGE=ghcr.io/agoric/agoric-3-proposals:pr33
ARG DEST_IMAGE=ghcr.io/agoric/agoric-sdk:dev
ARG BOOTSTRAP_MODE=main

# TODO different naming scheme for upgrade handler (in app.go) and the image name

# UPGRADE
FROM ${BASE_IMAGE} as propose-agoric-upgrade-12
ARG BOOTSTRAP_MODE UPGRADE_INFO_12
ENV THIS_NAME= UPGRADE_TO=agoric-upgrade-12 UPGRADE_INFO=${UPGRADE_INFO_12} BOOTSTRAP_MODE=${BOOTSTRAP_MODE}

WORKDIR /usr/src/agoric-sdk/
COPY --chmod=755 ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
SHELL ["/bin/bash", "-c"]
RUN . ./upgrade-test-scripts/start_to_to.sh
# BASE
FROM ${BASE_IMAGE} as base-wallet-factory-upgrade

# DEST (TEST)
#this is agoric-upgrade-12 / multi-collateral, etc.
#this is wallet-factory-upgrade
ARG DEST_IMAGE
FROM ${DEST_IMAGE} as agoric-upgrade-12
FROM ${DEST_IMAGE} as wallet-factory-upgrade
ARG BOOTSTRAP_MODE
ENV THIS_NAME=agoric-upgrade-12 BOOTSTRAP_MODE=${BOOTSTRAP_MODE} USE_JS=1
COPY --from=propose-agoric-upgrade-12 /root/.agoric /root/.agoric
ENV THIS_NAME=wallet-factory-upgrade BOOTSTRAP_MODE=${BOOTSTRAP_MODE} USE_JS=1
COPY --from=base-wallet-factory-upgrade /root/.agoric /root/.agoric
# start-chain boilerplate
WORKDIR /usr/src/agoric-sdk/
COPY ./env_setup.sh ./start_to_to.sh ./package.json ./*.js ./upgrade-test-scripts/
Expand Down
9 changes: 3 additions & 6 deletions packages/deployment/upgrade-test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ BUILD = docker build --progress=plain $(BUILD_OPTS) \
--build-arg BOOTSTRAP_MODE=$(BOOTSTRAP_MODE) --build-arg DEST_IMAGE=$(DEST_IMAGE) \
-f Dockerfile upgrade-test-scripts

propose-agoric-upgrade-12:
$(BUILD) --target propose-agoric-upgrade-12 -t $(REPOSITORY):propose-agoric-upgrade-12$(TAG_SUFFIX)

agoric-upgrade-12: propose-agoric-upgrade-12
$(BUILD) --target agoric-upgrade-12 -t $(REPOSITORY):agoric-upgrade-12$(TAG_SUFFIX)
wallet-factory-upgrade:
$(BUILD) --target wallet-factory-upgrade -t $(REPOSITORY):wallet-factory-upgrade

# build main bootstrap
build: $(TARGET)
Expand All @@ -43,4 +40,4 @@ run_test:
shell:
docker exec -it `docker ps --latest --format json | jq -r .Names` bash

.PHONY: local_sdk agoric-upgrade-7-2 agoric-upgrade-8 agoric-upgrade-8-1 agoric-upgrade-9 agoric-upgrade-10 agoric-upgrade-11 agoric-upgrade-12 build build_test run
.PHONY: local_sdk wallet-factory-upgrade build build_test run

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"scripts": {
"agops": "yarn --cwd /usr/src/agoric-sdk/ --silent agops",
"upgrade-tests": "ava --serial agoric-upgrade*/**/pre.test.js agoric-upgrade*/**/actions.test.js agoric-upgrade*/**/post.test.js"
"upgrade-tests": "ava --serial */**/pre.test.js */**/actions.test.js */**/post.test.js"
},
"ava": {
"files": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import test from 'ava';

import { agops } from '../cliHelper.js';
import { GOV1ADDR } from '../constants.js';
import { adjustVault, closeVault, mintIST, openVault } from '../econHelpers.js';

test.before(async t => {
await mintIST(GOV1ADDR, 12340000000, 10000, 2000);
});

test.skip('Open Vaults', async t => {
const currentVaults = await agops.vaults('list', '--from', GOV1ADDR);
t.is(currentVaults.length, 5);

// TODO get as return value from openVault
const vaultId = 'vault6';
await openVault(GOV1ADDR, 7, 11);
await adjustVault(GOV1ADDR, vaultId, { giveMinted: 1.5 });
await adjustVault(GOV1ADDR, vaultId, { giveCollateral: 2.0 });
await closeVault(GOV1ADDR, vaultId, 5.75);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import test from 'ava';
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import test from 'ava';

import { waitForBlock } from '../commonUpgradeHelpers.js';

test.before(async () => {
console.log('Wait for upgrade to settle');

await waitForBlock(5);
});

0 comments on commit e00e2c9

Please sign in to comment.