Commit 816653f0 authored by Will Lahti's avatar Will Lahti
Browse files

[FAB-10334] make unit-test fails locally on master

When running 'make unit-test' locally using the lastest master,
the peer/chaincode package fails. This is due to TestInstall
relying on chaincode devmode being enabled by another test
instead of explicitly setting it.

Change-Id: If5618846c97b1a0c9b49d9b0901cf3eeeb3289b8
Signed-off-by: default avatarWill Lahti <>
parent e9c51c10
......@@ -145,25 +145,20 @@ func TestInstallFromBadPackage(t *testing.T) {
t.Fatal("expected error installing bad package")
func installEx02(t *testing.T) error {
defer viper.Reset()
viper.Set("chaincode.mode", "dev")
func installEx02() error {
signer, err := common.GetDefaultSigner()
if err != nil {
return fmt.Errorf("Get default signer error: %v", err)
fsPath := "/tmp/installtest"
cmd, mockCF := initInstallTest(fsPath, t)
defer cleanupInstallTest(fsPath)
mockResponse := &pb.ProposalResponse{
Response: &pb.Response{Status: 200},
Endorsement: &pb.Endorsement{},
mockEndorserClients := []pb.EndorserClient{common.GetMockEndorserClient(mockResponse, nil)}
mockCF := &ChaincodeCmdFactory{
EndorserClients: mockEndorserClients,
Signer: signer,
cmd := installCmd(mockCF)
mockEndorserClient := common.GetMockEndorserClient(mockResponse, nil)
mockCF.EndorserClients = []pb.EndorserClient{mockEndorserClient}
args := []string{"-n", "example02", "-p", "", "-v", "anotherversion"}
......@@ -177,7 +172,7 @@ func installEx02() error {
func TestInstall(t *testing.T) {
if err := installEx02(); err != nil {
if err := installEx02(t); err != nil {
t.Fatalf("Install failed with error: %v", err)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment