Skip to content

Commit

Permalink
Fabric setup for running integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: Abhay Kishore <[email protected]>
  • Loading branch information
abhakish authored and arsulegai committed Aug 22, 2022
1 parent c01b084 commit 7726dda
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/fabric_integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Fabric Integration Tests

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Clone the repository
uses: "actions/checkout@v2"
- name: Setup JDK 8
uses: "actions/setup-java@v2"
with:
java-version: '8'
distribution: 'adopt-openj9'
- name: Run integration tests
run: |
chmod +x ./scripts/run-integration-tests.sh
./scripts/run-integration-tests.sh
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ target/
*.iml

#env
.env
/config/application.yml
application.yml
/config/connection-*
Expand Down
16 changes: 16 additions & 0 deletions src/test/java/fabricSetup/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#default env. vars settings
#TLS:
#ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_TLS=true
#ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_CA_TLS=--tls.enabled
ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_TLS=false
ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_CA_TLS=
ORG_HYPERLEDGER_FABRIC_SDKTEST_INTEGRATIONTESTS_CLIENT_AUTH_REQUIRED=false
#
#Image tags - Fabric versions.

##V 2.1
FAB_CONFIG_GEN_VERS=v2.1
V11_IDENTITIES_ALLOWREMOVE=--cfg.identities.allowremove
V11_AFFILIATIONS_ALLOWREMOVE=--cfg.affiliations.allowremove
IMAGE_TAG_FABRIC=:2.1
IMAGE_TAG_FABRIC_CA=:1.4
2 changes: 1 addition & 1 deletion src/test/java/hlf/java/rest/client/IT/ChannelIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class ChannelIT {

@Autowired ChannelService channelService;
private static final String CHANNEL_NAME = "test2";
private static final String CHANNEL_NAME = "test1";
private static final String ORG_MSP = "Org1MSP";

@Test
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fabric:
name: clientUser
orgConnectionConfig:
path: "src/test/resources/testconfig"
filename: connection.yml
filename: fabric-connection.yml
client:
rest:
apikey: ePVYHwAaQ0V1XOTX6U
Expand Down
29 changes: 29 additions & 0 deletions src/test/resources/testconfig/fabric-connection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: fabric-network
version: 1.0.0
client:
organization: Org1
connection:
timeout:
peer:
endorser: '300'
organizations:
Org1:
mspid: Org1MSP
peers:
- peer0.org1.example.com
certificateAuthorities:
- ca-org1
peers:
peer0.org1.example.com:
url: grpc://localhost:7051
tlsCACerts:
path: src/test/java/fabricSetup/e2e-2Orgs/v2.1/crypto-config/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem

certificateAuthorities:
ca-org1:
url: https://localhost:7054
caName: ca0
tlsCACerts:
path: src/test/java/fabricSetup/e2e-2Orgs/v2.1/crypto-config/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem
httpOptions:
verify: true

0 comments on commit 7726dda

Please sign in to comment.