Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sink772/443b0abd0be1176b4ccb334205516450 to your computer and use it in GitHub Desktop.
Save sink772/443b0abd0be1176b4ccb334205516450 to your computer and use it in GitHub Desktop.

How to run goloop/testsuite with gochain docker image

Requirements

Build and Run

Source checkout

First of all, you need to checkout the goloop repository.

$ git clone git@github.com:icon-project/goloop.git

Build gochain docker image

$ cd goloop
$ make gochain-image

If the command runs successfully, it generates the docker image like the following.

$ docker images goloop/gochain
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
goloop/gochain      latest              f0f98ef0d461        2 minutes ago       511MB

Run testsuite

Before running testsuite, you need to clean javaee build objects that were generated during the docker image build.

$ make javarun-clean

Then, run the following command under testsuite directory.

$ cd testsuite
$ ./gradlew testJavaScore -DUSE_DOCKER=true

Note that the above command is only for running Java SCORE test cases. For more information about other available test targets, please check the testsuite README.

@CyrusVorwald
Copy link

CyrusVorwald commented Jul 21, 2022

Hello,

./gradlew testJavaScore -DUSE_DOCKER=true fails for me with error

foundation.icon.test.cases.JavaAPITest > initializationError FAILED
    java.net.ConnectException at JavaAPITest.java:86
        Caused by: java.net.ConnectException at JavaAPITest.java:86

Likely culprit:

grep: ./data/chainenv/java.props: No such file or directory

All previous steps work. Please advise how I can run these tests without error.

EDIT: Seems that this works when already running goloop. I was able to get it to run using gochain-local.

@sink772
Copy link
Author

sink772 commented Jul 22, 2022

The build.gradle under testsuite would automatically start the docker container, goloop/gochain (not goloop/gochain-icon), when you specify -DUSE_DOCKER=true property. So you do not need to start the gochain-local docker beforehand, which is using goloop/gochain-icon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment