Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update JavaScript references to use the latest stellar-sdk #81

Merged
merged 13 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/Dockerfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- master
tags:
- '*'
- '*'
pull_request:
release:
types: [published]
Expand All @@ -25,7 +25,7 @@ env:
RUST_TOOLCHAIN_VERSION: stable
SOROBAN_CLI_GIT_REF: https://github.com/stellar/soroban-tools.git#main
QUICKSTART_GIT_REF: https://github.com/stellar/quickstart.git#master
JS_SOROBAN_CLIENT_NPM_VERSION: https://github.com/stellar/js-soroban-client.git#main
JS_SOROBAN_CLIENT_NPM_VERSION: https://github.com/stellar/js-stellar-sdk.git#master
jobs:
complete:
if: always()
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
- if: ${{ env.PUSH_ENABLED == 'true' }}
name: Save Docker Image to file
run: |
docker save ${{ env.IMAGE }} -o /tmp/image;
docker save ${{ env.IMAGE }} -o /tmp/image;
- if: ${{ env.PUSH_ENABLED == 'true' }}
name: Upload System Test Image
uses: actions/upload-artifact@v2
Expand All @@ -66,7 +66,7 @@ jobs:

push:
# Only push non 'vX.Y.Z' tags as pre-built system test image with versions compiled into image.
# pr's and releases don't need to be pushed as docker images, because system test is meant to be built
# pr's and releases don't need to be pushed as docker images, because system test is meant to be built
# from source locally.
needs: build
permissions:
Expand All @@ -88,5 +88,3 @@ jobs:
registry: ${{ secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io' }}
username: ${{ secrets.DOCKERHUB_USERNAME || github.actor }}
password: ${{ secrets.DOCKERHUB_TOKEN || github.token }}


27 changes: 15 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# System Test Releases

#### Unreleased

* js invocation upgraded to use [`stellar-sdk`](https://github.com/stellar/js-stellar-sdk) rather than the now-deprecated `soroban-client`. [system-test, #81](https://github.com/stellar/system-test/pull/81)

#### 1.0.19

* js verification of contract invoke results, compare as strings. [system-test, #68](https://github.com/stellar/system-test/pull/68)
Expand Down Expand Up @@ -39,7 +43,7 @@

#### 1.0.9

* Fix bug in NODEJS test invocation. [system-test, #46](https://github.com/stellar/system-test/pull/46)
* Fix bug in NODEJS test invocation. [system-test, #46](https://github.com/stellar/system-test/pull/46)


#### 1.0.8
Expand All @@ -64,31 +68,31 @@

#### 1.0.5

* Fixed `--TargetNetwork futurenet`, was incorrectly trying to configure artificial acceleration on core config also, which is only allowed on `standalone`. [system-test, #25](https://github.com/stellar/system-test/pull/25).
* Fixed `--TargetNetwork futurenet`, was incorrectly trying to configure artificial acceleration on core config also, which is only allowed on `standalone`. [system-test, #25](https://github.com/stellar/system-test/pull/25).

This version of tests is based on [Soroban Preview 7](https://soroban.stellar.org/docs/releases) system interfaces.
This version of tests is based on [Soroban Preview 7](https://soroban.stellar.org/docs/releases) system interfaces.

#### 1.0.4

* Fixed git ref resolution to detached head state when compiling soroban cli during image build [system-test, #23](https://github.com/stellar/system-test/pull/23), to build [Stellar Quickstart](https://github.com/stellar/quickstart).
* Fixed git ref resolution to detached head state when compiling soroban cli during image build [system-test, #23](https://github.com/stellar/system-test/pull/23), to build [Stellar Quickstart](https://github.com/stellar/quickstart).

This version of tests is based on [Soroban Preview 7](https://soroban.stellar.org/docs/releases) system interfaces.
This version of tests is based on [Soroban Preview 7](https://soroban.stellar.org/docs/releases) system interfaces.

#### 1.0.3

* Modified test framework, [system-test, #21](https://github.com/stellar/system-test/pull/21), to build [Stellar Quickstart](https://github.com/stellar/quickstart) as the base image.
Refer to [README.md](https://github.com/stellar/system-test#readme) for new two step process of running tests:
(1) run make with server versions, creates docker image
(2) run the docker image to run tests.
* Modified test framework, [system-test, #21](https://github.com/stellar/system-test/pull/21), to build [Stellar Quickstart](https://github.com/stellar/quickstart) as the base image.
Refer to [README.md](https://github.com/stellar/system-test#readme) for new two step process of running tests:
(1) run make with server versions, creates docker image
(2) run the docker image to run tests.


This version of tests is based on [Soroban Preview 7](https://soroban.stellar.org/docs/releases) system interfaces.
This version of tests is based on [Soroban Preview 7](https://soroban.stellar.org/docs/releases) system interfaces.

#### 1.0.2

* Modified tests to follow the new dynamic args format on cli [soroban-tools, #307](https://github.com/stellar/soroban-tools/pull/307)

This version of tests is based on [Soroban Preview 6](https://soroban.stellar.org/docs/releases#preview-6-january-9th-2023) system interfaces, combined with the additional change applied on top of dynamic args in cli `contract invoke`
This version of tests is based on [Soroban Preview 6](https://soroban.stellar.org/docs/releases#preview-6-january-9th-2023) system interfaces, combined with the additional change applied on top of dynamic args in cli `contract invoke`


#### 1.0.1
Expand All @@ -105,4 +109,3 @@ First release of packaged system tests. Initial focus is on Soroban e2e cases us
* DApp developer compiles, deploys and invokes a contract

This version of tests execute the [Soroban Preview 5](https://soroban.stellar.org/docs/releases#preview-5-december-8th-2022) system interfaces only.

30 changes: 15 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ARG QUICKSTART_IMAGE_REF=stellar/quickstart:soroban-dev
ARG SOROBAN_CLI_IMAGE_REF=stellar/system-test-soroban-cli:dev

FROM golang:1.20 as go
FROM golang:1.21 as go

RUN ["mkdir", "-p", "/test"]
RUN ["mkdir", "-p", "/test/bin"]
RUN ["mkdir", "-p", "/test"]
RUN ["mkdir", "-p", "/test/bin"]

WORKDIR /test
ADD go.mod go.sum ./
Expand All @@ -13,7 +13,7 @@ ADD e2e.go ./
ADD features ./features

# build each feature folder with go test module.
# compiles each feature to a binary to be executed,
# compiles each feature to a binary to be executed,
# and copies the .feature file with it for runtime.
RUN go test -c -o ./bin/dapp_develop_test.bin ./features/dapp_develop/...
ADD features/dapp_develop/dapp_develop.feature ./bin
Expand All @@ -30,7 +30,7 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y build-essential expect git && apt-get clean

# Install Rust
RUN ["mkdir", "-p", "/rust"]
RUN ["mkdir", "-p", "/rust"]
ENV CARGO_HOME=/rust/.cargo
ENV RUSTUP_HOME=/rust/.rust
ENV RUST_TOOLCHAIN_VERSION=$RUST_TOOLCHAIN_VERSION
Expand Down Expand Up @@ -64,20 +64,20 @@ RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
ENV PATH="/home/tester/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
RUN npm install -g ts-node yarn

# Install js-soroban-client
ARG JS_SOROBAN_CLIENT_NPM_VERSION
# Install js-stellar-sdk
ARG JS_STELLAR_SDK_NPM_VERSION
ADD package.json /home/tester/
ADD js-soroban-client /home/tester/js-soroban-client
ADD js-stellar-sdk /home/tester/js-stellar-sdk
RUN sudo chown -R tester:tester /home/tester
RUN yarn install --network-concurrency 1
RUN if echo "$JS_SOROBAN_CLIENT_NPM_VERSION" | grep -q '.*file:.*'; then \
cd /home/tester/js-soroban-client; \
yarn cache clean; \
yarn install --network-concurrency 1; \
cd /home/tester; \
yarn add ${JS_SOROBAN_CLIENT_NPM_VERSION} --network-concurrency 1; \
RUN if echo "$JS_STELLAR_SDK_NPM_VERSION" | grep -q '.*file:.*'; then \
cd /home/tester/js-stellar-sdk; \
yarn cache clean; \
yarn install --network-concurrency 1; \
cd /home/tester; \
yarn add ${JS_STELLAR_SDK_NPM_VERSION} --network-concurrency 1; \
else \
yarn add "soroban-client@${JS_SOROBAN_CLIENT_NPM_VERSION}" --network-concurrency 1; \
yarn add "stellar-sdk@${JS_STELLAR_SDK_NPM_VERSION}" --network-concurrency 1; \
fi

ADD *.ts /home/tester/bin/
Expand Down
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ SOROBAN_CLI_GIT_REF=https://github.com/stellar/soroban-tools.git\#main
GO_GIT_REF=https://github.com/stellar/go.git\#master
QUICKSTART_GIT_REF=https://github.com/stellar/quickstart.git\#master
# specify the published npm repo version of soroban-client js library, or you can specify gh git ref url as the version also
JS_SOROBAN_CLIENT_NPM_VERSION=https://github.com/stellar/js-soroban-client.git\#main
JS_STELLAR_SDK_NPM_VERSION=https://github.com/stellar/js-stellar-sdk.git\#master

# variables to set if wanting to use existing dockerhub images instead of compiling
# image during build. if using this option, the image ref should provide a version for same
# image during build. if using this option, the image ref should provide a version for same
# platform arch as the build host is on, i.e. linux/amd64 or linux/arm64.
#
# image must have soroban cli bin at /usr/local/cargo/bin/soroban
Expand All @@ -43,7 +43,7 @@ FRIENDBOT_IMAGE=
# image must have core bin at /usr/local/bin/stellar-core
CORE_IMAGE=
#
# a prebuilt 'soroban-dev' image from the quickstart repo, if this is supplied,
# a prebuilt 'soroban-dev' image from the quickstart repo, if this is supplied,
# the other core, rpc, horizon, friendbot config settings are mostly ignored, since the quickstart image
# has them compiled in already. the 'stellar/quickstart' images also support multi-arch, so the build will
# work those images whether the build host is arm64 or amd64.
Expand All @@ -54,11 +54,11 @@ NODE_VERSION?=16.20.2
# if crate version is set, then it overrides SOROBAN_CLI_GIT_REF, cli will be installed from this create instead
SOROBAN_CLI_CRATE_VERSION=

# sets the rustc version in the system test image
# sets the rustc version in the system test image
RUST_TOOLCHAIN_VERSION=stable

# temporarily needed, builds core with soroban enabled features
CORE_COMPILE_CONFIGURE_FLAGS=--disable-tests --enable-next-protocol-version-unsafe-for-production
CORE_COMPILE_CONFIGURE_FLAGS=--disable-tests

# the final image name that is created in local docker images store for system test
SYSTEM_TEST_IMAGE=stellar/system-test:dev
Expand All @@ -73,7 +73,7 @@ build-friendbot:
docker build -t "$(FRIENDBOT_STAGE_IMAGE)" \
--build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \
-f services/friendbot/docker/Dockerfile "$$SOURCE_URL"; \
fi
fi

build-soroban-rpc:
if [ -z "$(QUICKSTART_IMAGE)" ] && [ -z "$(SOROBAN_RPC_IMAGE)" ]; then \
Expand Down Expand Up @@ -109,7 +109,7 @@ build-horizon:
--target builder -f services/horizon/docker/Dockerfile.dev "$$SOURCE_URL"; \
fi

build-core:
build-core:
if [ -z "$(QUICKSTART_IMAGE)" ] && [ -z "$(CORE_IMAGE)" ]; then \
SOURCE_URL="$(CORE_GIT_REF)"; \
if [[ ! "$(CORE_GIT_REF)" =~ \.git ]]; then \
Expand All @@ -136,6 +136,8 @@ build-quickstart: build-core build-friendbot build-horizon build-soroban-rpc
docker build -t "$(QUICKSTART_STAGE_IMAGE)" \
--build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \
--build-arg STELLAR_CORE_IMAGE_REF=$$CORE_IMAGE_REF \
--build-arg CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \
--build-arg CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE=true \
--build-arg HORIZON_IMAGE_REF=$$HORIZON_IMAGE_REF \
--build-arg FRIENDBOT_IMAGE_REF=$$FRIENDBOT_IMAGE_REF \
--build-arg SOROBAN_RPC_IMAGE_REF=$$SOROBAN_RPC_IMAGE_REF \
Expand All @@ -152,5 +154,5 @@ build: build-quickstart build-soroban-cli
--build-arg SOROBAN_CLI_IMAGE_REF=$$SOROBAN_CLI_IMAGE_REF \
--build-arg RUST_TOOLCHAIN_VERSION=$(RUST_TOOLCHAIN_VERSION) \
--build-arg NODE_VERSION=$(NODE_VERSION) \
--build-arg JS_SOROBAN_CLIENT_NPM_VERSION=$(JS_SOROBAN_CLIENT_NPM_VERSION) \
--build-arg JS_STELLAR_SDK_NPM_VERSION=$(JS_STELLAR_SDK_NPM_VERSION) \
--label org.opencontainers.image.revision="$(SYSTEM_TEST_SHA)" .;
Loading
Loading