From 191b62135b0e91d2d71fae93994c143e4ed9518c Mon Sep 17 00:00:00 2001 From: Andrew Nguyen Date: Tue, 19 Feb 2019 11:30:20 -0500 Subject: [PATCH] added assumptions print for integration tests --- cmd/db/dynamodb.go | 2 +- config/config.go | 40 ++++++++++++++--------------- db/queries.go | 2 +- node/config.go | 2 +- tests/integration/developer_test.go | 18 ++++++++----- tests/integration/dispatch_test.go | 2 ++ tests/integration/service_test.go | 2 ++ 7 files changed, 38 insertions(+), 30 deletions(-) diff --git a/cmd/db/dynamodb.go b/cmd/db/dynamodb.go index 3797e32a2..e59f6179b 100644 --- a/cmd/db/dynamodb.go +++ b/cmd/db/dynamodb.go @@ -4,7 +4,7 @@ import ( "fmt" "os" "sync" - + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/dynamodb" diff --git a/config/config.go b/config/config.go index e7bb29390..0aff47afd 100644 --- a/config/config.go +++ b/config/config.go @@ -5,31 +5,31 @@ import ( "flag" "fmt" "sync" - + "github.com/pokt-network/pocket-core/const" ) // TODO configuration updating through CLI type config struct { - GID string `json:"GID"` // This variable holds self.GID. - CID string `json:"CLIENTID"` // This variable holds a client identifier string. - Ver string `json:"VERSION"` // This variable holds the client version string. - DD string `json:"DATADIR"` // This variable holds the working directory string. - CRPC bool `json:"CRPC"` // This variable describes if the client rpc is running. - CRPCPort string `json:"CRPCPORT"` // This variable holds the client rpc port string. - RRPC bool `json:"RRPC"` // This variable describes if the relay rpc is running. - RRPCPort string `json:"RRPCPort"` // This variable holds the relay rpc port string. - CFile string `json:"HOSTEDCHAINS"` // This variable holds the filepath to the chains.json. - PFile string `json:"PEERFILE"` // This variable holds the filepath to the peerFile.json. - SNWL string `json:"SNWL"` // This variable holds the filepath to the service_whitelist.json. - DWL string `json:"DWL"` // This variable holds the filepath to the developer_whitelist.json - Dispatch bool `json:"DISPATCH"` // This variable describes whether or not this node is a dispatcher - DisMode int `json:"DISMODE"` // The mode by which the dispatch runs in (NORM, MIGRATE, DEPCRECATED) - DBEndpoint string `json:"DBENDPOINT"` // The endpoint of the centralized database for dispatch configuration - DBTableName string `json:"DBTABLE"` // The table name of the centralized dispatcher database - DisIP string `json:"DISIP"` // The IP address of the centralized dispatcher - DisCPort string `json:"DISCPort"` // The client port of the centralized dispatcher - DisRPort string `json:"DISCPort"` // The relay port of the centralized dispatcher + GID string `json:"GID"` // This variable holds self.GID. + CID string `json:"CLIENTID"` // This variable holds a client identifier string. + Ver string `json:"VERSION"` // This variable holds the client version string. + DD string `json:"DATADIR"` // This variable holds the working directory string. + CRPC bool `json:"CRPC"` // This variable describes if the client rpc is running. + CRPCPort string `json:"CRPCPORT"` // This variable holds the client rpc port string. + RRPC bool `json:"RRPC"` // This variable describes if the relay rpc is running. + RRPCPort string `json:"RRPCPort"` // This variable holds the relay rpc port string. + CFile string `json:"HOSTEDCHAINS"` // This variable holds the filepath to the chains.json. + PFile string `json:"PEERFILE"` // This variable holds the filepath to the peerFile.json. + SNWL string `json:"SNWL"` // This variable holds the filepath to the service_whitelist.json. + DWL string `json:"DWL"` // This variable holds the filepath to the developer_whitelist.json + Dispatch bool `json:"DISPATCH"` // This variable describes whether or not this node is a dispatcher + DisMode int `json:"DISMODE"` // The mode by which the dispatch runs in (NORM, MIGRATE, DEPCRECATED) + DBEndpoint string `json:"DBENDPOINT"` // The endpoint of the centralized database for dispatch configuration + DBTableName string `json:"DBTABLE"` // The table name of the centralized dispatcher database + DisIP string `json:"DISIP"` // The IP address of the centralized dispatcher + DisCPort string `json:"DISCPort"` // The client port of the centralized dispatcher + DisRPort string `json:"DISCPort"` // The relay port of the centralized dispatcher } var ( diff --git a/db/queries.go b/db/queries.go index f409abb9f..06b761878 100644 --- a/db/queries.go +++ b/db/queries.go @@ -3,7 +3,7 @@ package db import ( "fmt" - + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute" diff --git a/node/config.go b/node/config.go index a12d2a995..4c6a94b13 100644 --- a/node/config.go +++ b/node/config.go @@ -2,7 +2,7 @@ package node import ( "fmt" - + "github.com/pokt-network/pocket-core/config" "github.com/pokt-network/pocket-core/logs" "github.com/pokt-network/pocket-core/util" diff --git a/tests/integration/developer_test.go b/tests/integration/developer_test.go index dbeec1a3f..eebf37cec 100644 --- a/tests/integration/developer_test.go +++ b/tests/integration/developer_test.go @@ -11,13 +11,14 @@ import ( "github.com/pokt-network/pocket-core/util" ) -/* -Integration Testing Assumptions: -1) Dispatcher is hosting a testrpc instance that is labeled as (Blockchain: 0 | NetworkID: 0 | Version: 0) in chains.json file -2) Dispatcher has white listed DEVID1 (Dev) and GID1 (SN) -3) Dispatcher is running on DispIP:DisRPort -4) Dispatcher has valid aws credentials for DB test -*/ + +const assumptions = + "Integration Testing Assumptions:\n"+ + "1) Dispatcher is hosting a testrpc instance that is labeled as (Blockchain: ethereum | NetworkID: 0 | Version: 0) in chains.json file\n"+ + "2) Dispatcher has white listed DEVID1 (Dev) and GID1 (SN)\n"+ + "3) Dispatcher is running on DispIP:DisRPort\n"+ + "4) Dispatcher has valid aws credentials for DB test" + type PORT int @@ -49,6 +50,7 @@ func requestFromFile(urlSuffix string, port PORT) (string, error) { func TestRelay(t *testing.T) { resp, err := requestFromFile("relay", Relay) if err != nil { + t.Log(assumptions) t.Fatalf(err.Error()) } t.Log(resp) @@ -57,6 +59,7 @@ func TestRelay(t *testing.T) { func TestReport(t *testing.T) { resp, err := requestFromFile("report", Relay) if err != nil { + t.Log(assumptions) t.Fatalf(err.Error()) } t.Log(resp) @@ -65,6 +68,7 @@ func TestReport(t *testing.T) { func TestDispatch(t *testing.T) { resp, err := requestFromFile("dispatch", Relay) if err != nil { + t.Log(assumptions) t.Fatalf(err.Error()) } t.Log(resp) diff --git a/tests/integration/dispatch_test.go b/tests/integration/dispatch_test.go index 75b1f0887..b7ecea551 100644 --- a/tests/integration/dispatch_test.go +++ b/tests/integration/dispatch_test.go @@ -25,10 +25,12 @@ func TestDB(t *testing.T) { n := DummyNode() _, err := db.DB().Add(n) if err != nil { + t.Log(assumptions) t.Fatalf(err.Error()) } _, err = db.DB().Remove(n) if err != nil { + t.Log(assumptions) t.Fatalf(err.Error()) } } diff --git a/tests/integration/service_test.go b/tests/integration/service_test.go index 205cfd3d8..9193025ca 100644 --- a/tests/integration/service_test.go +++ b/tests/integration/service_test.go @@ -5,6 +5,7 @@ import "testing" func TestRegister(t *testing.T) { resp, err := requestFromFile("register", Client) if err != nil { + t.Log(assumptions) t.Fatalf(err.Error()) } t.Log(resp) @@ -13,6 +14,7 @@ func TestRegister(t *testing.T) { func TestUnRegister(t *testing.T) { resp, err := requestFromFile("unregister", Client) if err != nil { + t.Log(assumptions) t.Fatalf(err.Error()) } t.Log(resp)