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

Event relayer as a messaging layer for Java sdk #126

Merged
merged 23 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8cc5547
Initial event relay in SDK
drinkcoffee May 16, 2022
1b221de
Add ability for SFC to use Relayer
drinkcoffee May 16, 2022
2b106a5
Refactor messaging manager group objects to handle wsUri
drinkcoffee May 18, 2022
77e08bc
Initial attempt at splitting tests
drinkcoffee May 20, 2022
6ffa035
Fix circle ci file
drinkcoffee May 20, 2022
10274d0
Add generated source files to class path for integration and performa…
drinkcoffee May 23, 2022
a3bc054
Add generated source files to class path for integration
drinkcoffee May 23, 2022
fa4ce7b
Exclude integration and performance tests when compiling code
drinkcoffee May 23, 2022
aff10f0
Merge split branch
drinkcoffee May 23, 2022
00bcee4
Merge branch 'main' into event-relayer-java-sdk
drinkcoffee May 23, 2022
da8e553
Spotless
drinkcoffee May 23, 2022
ce28966
Add more error checking + reduce execution time
drinkcoffee May 24, 2022
feea171
Fix issues using verifier
drinkcoffee May 24, 2022
7d8d56a
Merge branch 'main' into event-relayer-java-sdk
drinkcoffee May 24, 2022
57f6c6f
Add test to make it easy to run the private key generator
drinkcoffee May 24, 2022
9688d2f
Improved error messages and logging
drinkcoffee May 24, 2022
49e24f9
Rename polling period to indicate in ms, and have time out and retry …
drinkcoffee May 24, 2022
9fc206c
Spotless
drinkcoffee May 24, 2022
5ef05b7
Set-up dispatcher based on recent changes on how dispatcher configured
drinkcoffee May 24, 2022
38b13ce
Have relayer build task build test code too
drinkcoffee May 25, 2022
5f98a6b
Fix compilation issue
drinkcoffee May 25, 2022
3911fae
Wire build all relayer code from Circle CI to make file
drinkcoffee May 25, 2022
d9b254f
Ensure all SFC tests pass by adding pause to ensure target chain tran…
drinkcoffee May 25, 2022
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
Prev Previous commit
Next Next commit
Initial attempt at splitting tests
  • Loading branch information
drinkcoffee committed May 20, 2022
commit 77e08bc982a4ba48c36613247cbc58d837042d2a
106 changes: 106 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,112 @@ jobs:
- store_artifacts:
path: ~/test-results/junit

intTestsMachine:
machine:
image: ubuntu-2004:202107-02
resource_class: large
steps:
# The home directory is: /home/circleci/project
# gpact is cloned to: /home/circleci/project/.
# web3j is cloned to: /home/circleci/web3j-abi
- prepare
- run:
name: Build web3j
command: |
# Build our Web3j
cd ../web3j-abi
./gradlew --parallel --stacktrace --info --build-cache installDist
- run:
name: Create Relayer containers
working_directory: services/relayer
command: make docker
- run:
name: Create Message Store container
working_directory: services/message-store
command: make docker
- run:
name: Create and Start blockchains
working_directory: test-blockchains
background: true
command: docker-compose build && docker-compose up
- run: sleep 30
- run:
name: Build and test
command: ./gradlew test
- run:
name: Stop blockchains
working_directory: test-blockchains
command: docker-compose stop
when: always
- run:
name: Logs from bc31
working_directory: test-blockchains
command: |
docker container logs test-blockchains_bc31node1_1
when: always
- run:
name: Logs from bc32
working_directory: test-blockchains
command: |
docker container logs test-blockchains_bc32node1_1
when: always
- run:
name: Logs from bc33
working_directory: test-blockchains
command: |
docker container logs test-blockchains_bc33node1_1
when: always
- run:
name: Logs from observer1
working_directory: test-blockchains
command: |
docker container logs observer1
when: always
- run:
name: Logs from observer2
working_directory: test-blockchains
command: |
docker container logs observer2
when: always
- run:
name: Logs from observer3
working_directory: test-blockchains
command: |
docker container logs observer3
when: always
- run:
name: Logs from relayer
working_directory: test-blockchains
command: |
docker container logs relayer
when: always
- run:
name: Logs from dispatcher
working_directory: test-blockchains
command: |
docker container logs dispatcher
when: always
- run:
name: Logs from msgstore
working_directory: test-blockchains
command: |
docker container logs msgstore
when: always
- run:
name: Remove blockchains
working_directory: test-blockchains
command: docker-compose down
when: always
- run:
name: Save test results
command: |
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/test-results/junit/ \;
when: always
- store_test_results:
path: ~/test-results
- store_artifacts:
path: ~/test-results/junit


relayer-build:
Expand Down
55 changes: 55 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ allprojects {
}
}


ext {
log4JVersion = '2.17.1'
okHttpVersion = '4.9.1'
Expand All @@ -52,6 +53,59 @@ subprojects {
test {
useJUnitPlatform()
}

if (file('src/intTest').directory) {
sourceSets {
intTest {
compileClasspath += sourceSets.main.output + sourceSets.main.compileClasspath + sourceSets.test.compileClasspath
runtimeClasspath += sourceSets.main.output + sourceSets.main.runtimeClasspath + sourceSets.test.runtimeClasspath
}
}

configurations {
intTestImplementation.extendsFrom implementation
intTestRuntimeOnly.extendsFrom runtimeOnly
}

tasks.register('intTest', Test) {
description = 'Runs integration tests.'
group = 'verification'

testClassesDirs = sourceSets.intTest.output.classesDirs
classpath = sourceSets.intTest.runtimeClasspath
shouldRunAfter test
useJUnitPlatform()
}
check.dependsOn intTest
}

if (file('src/perfTest').directory) {
sourceSets {
perfTest {
compileClasspath += sourceSets.main.output + sourceSets.main.compileClasspath + sourceSets.test.compileClasspath
runtimeClasspath += sourceSets.main.output + sourceSets.main.runtimeClasspath + sourceSets.test.runtimeClasspath
}
}

configurations {
perfTestImplementation.extendsFrom implementation
perfTestRuntimeOnly.extendsFrom runtimeOnly
}

tasks.register('perfTest', Test) {
description = 'Runs performance tests.'
group = 'verification'

testClassesDirs = sourceSets.perfTest.output.classesDirs
classpath = sourceSets.perfTest.runtimeClasspath
shouldRunAfter test
useJUnitPlatform()
}
check.dependsOn perfTest
}



dependencies {
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: log4JVersion
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: log4JVersion
Expand All @@ -71,6 +125,7 @@ subprojects {
}
}


task solFormat {
dependsOn npm_run_solFormat
}
Expand Down
1 change: 0 additions & 1 deletion sdk/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ dependencies {
testImplementation "io.reactivex.rxjava2:rxjava:${rxJavaVersion}"

testImplementation project (':common-test')

}


Expand Down
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include 'contracttest'
include 'app-gpact-erc20bridge'
include 'app-sfc-erc20bridge'
include 'app-sfc-erc721bridge'

include 'examples-helpers'
include 'examples-gpact-conditional'
include 'examples-gpact-erc20bridge'
Expand Down Expand Up @@ -35,6 +36,7 @@ project(":app-sfc-erc20bridge").projectDir = file("applications/sfc/erc20bridge/
project(":app-sfc-erc721bridge").projectDir = file("applications/sfc/erc721bridge/javatest")

project(":examples-helpers").projectDir = file("examples/helpers")

project(":examples-gpact-conditional").projectDir = file("examples/gpact/conditional/java")
project(":examples-gpact-erc20bridge").projectDir = file("examples/gpact/erc20bridge/java")
project(":examples-gpact-hoteltrain").projectDir = file("examples/gpact/hotel-train/java")
Expand All @@ -54,4 +56,3 @@ project(":perf-singlebc-trade").projectDir = file("performance/singlebc/trade/ja
project(":perf-singlebc-write").projectDir = file("performance/singlebc/write/java")

project(":utils-pkey").projectDir = file("utils/pkey")