Skip to content

Commit 4da5047

Browse files
committed
[FAB-7629] Fix car platform test fixture
Fix chaincode archive platform test fixture so the test can run again. Change-Id: Ib70eb4035c2e2e5fb3c04c9b46ddec1c1670d0f9 Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
1 parent 254c1b6 commit 4da5047

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

core/chaincode/platforms/car/test/platform_test.go core/chaincode/platforms/car/platform_test.go

+13-10
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package test
17+
package car_test
1818

1919
import (
2020
"os"
21+
"path/filepath"
2122
"testing"
2223

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

3435
func TestCar_BuildImage(t *testing.T) {
3536
vm, err := container.NewVM()
36-
3737
if err != nil {
3838
t.Errorf("Error getting VM: %s", err)
3939
return
4040
}
41-
// Build the spec
42-
cwd, err := os.Getwd()
43-
if err != nil {
44-
t.Errorf("Error getting CWD: %s", err)
45-
return
46-
}
4741

48-
chaincodePath := cwd + "/org.hyperledger.chaincode.example02-0.1-SNAPSHOT.car"
49-
spec := &pb.ChaincodeSpec{Type: pb.ChaincodeSpec_CAR, ChaincodeId: &pb.ChaincodeID{Name: "cartest", Path: chaincodePath}, Input: &pb.ChaincodeInput{Args: util.ToChaincodeArgs("f")}}
42+
chaincodePath := filepath.Join("testdata", "/org.hyperledger.chaincode.example02-0.1-SNAPSHOT.car")
43+
spec := &pb.ChaincodeSpec{
44+
Type: pb.ChaincodeSpec_CAR,
45+
ChaincodeId: &pb.ChaincodeID{
46+
Name: "cartest",
47+
Path: chaincodePath,
48+
},
49+
Input: &pb.ChaincodeInput{
50+
Args: util.ToChaincodeArgs("f"),
51+
},
52+
}
5053
if err := vm.BuildChaincodeContainer(spec); err != nil {
5154
t.Error(err)
5255
}

unit-test/run.sh

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ excluded_packages=(
1313
"github.com/hyperledger/fabric/build/"
1414
"github.com/hyperledger/fabric/common/ledger/testutil"
1515
"github.com/hyperledger/fabric/common/mocks"
16-
"github.com/hyperledger/fabric/core/chaincode/platforms/car/test" # until FAB-7629 is resolved
1716
"github.com/hyperledger/fabric/core/deliverservice/mocks"
1817
"github.com/hyperledger/fabric/core/ledger/kvledger/example"
1918
"github.com/hyperledger/fabric/core/ledger/kvledger/marble_example"

0 commit comments

Comments
 (0)