Skip to content

Commit

Permalink
[FAB-7629] Fix car platform test fixture
Browse files Browse the repository at this point in the history
Fix chaincode archive platform test fixture so the test can run again.

Change-Id: Ib70eb4035c2e2e5fb3c04c9b46ddec1c1670d0f9
Signed-off-by: Matthew Sykes <[email protected]>
  • Loading branch information
sykesm committed Mar 21, 2018
1 parent 254c1b6 commit 4da5047
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package test
package car_test

import (
"os"
"path/filepath"
"testing"

"github.com/hyperledger/fabric/common/util"
Expand All @@ -33,20 +34,22 @@ func TestMain(m *testing.M) {

func TestCar_BuildImage(t *testing.T) {
vm, err := container.NewVM()

if err != nil {
t.Errorf("Error getting VM: %s", err)
return
}
// Build the spec
cwd, err := os.Getwd()
if err != nil {
t.Errorf("Error getting CWD: %s", err)
return
}

chaincodePath := cwd + "/org.hyperledger.chaincode.example02-0.1-SNAPSHOT.car"
spec := &pb.ChaincodeSpec{Type: pb.ChaincodeSpec_CAR, ChaincodeId: &pb.ChaincodeID{Name: "cartest", Path: chaincodePath}, Input: &pb.ChaincodeInput{Args: util.ToChaincodeArgs("f")}}
chaincodePath := filepath.Join("testdata", "/org.hyperledger.chaincode.example02-0.1-SNAPSHOT.car")
spec := &pb.ChaincodeSpec{
Type: pb.ChaincodeSpec_CAR,
ChaincodeId: &pb.ChaincodeID{
Name: "cartest",
Path: chaincodePath,
},
Input: &pb.ChaincodeInput{
Args: util.ToChaincodeArgs("f"),
},
}
if err := vm.BuildChaincodeContainer(spec); err != nil {
t.Error(err)
}
Expand Down
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion unit-test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ excluded_packages=(
"github.com/hyperledger/fabric/build/"
"github.com/hyperledger/fabric/common/ledger/testutil"
"github.com/hyperledger/fabric/common/mocks"
"github.com/hyperledger/fabric/core/chaincode/platforms/car/test" # until FAB-7629 is resolved
"github.com/hyperledger/fabric/core/deliverservice/mocks"
"github.com/hyperledger/fabric/core/ledger/kvledger/example"
"github.com/hyperledger/fabric/core/ledger/kvledger/marble_example"
Expand Down

0 comments on commit 4da5047

Please sign in to comment.