Skip to content

Commit

Permalink
added assumptions print for integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Nguyen committed Feb 19, 2019
1 parent 49d09b6 commit 191b621
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 30 deletions.
2 changes: 1 addition & 1 deletion cmd/db/dynamodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
40 changes: 20 additions & 20 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion db/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
18 changes: 11 additions & 7 deletions tests/integration/developer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/dispatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
2 changes: 2 additions & 0 deletions tests/integration/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 191b621

Please sign in to comment.