Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit dab5a98

Browse files
committed
[FAB-6146] Move fixture chaincode under testdata
Change-Id: I5ef9a7e8dcb34b2d428da183312651c16e71482d Signed-off-by: Troy Ronda <troy@troyronda.com>
1 parent a102eb3 commit dab5a98

File tree

8 files changed

+23
-8
lines changed

8 files changed

+23
-8
lines changed

pkg/fabric-client/packager/golang_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func TestPackageGoLangCC(t *testing.T) {
2222
if err != nil {
2323
t.Fatalf("error from os.Getwd %v", err)
2424
}
25-
os.Setenv("GOPATH", path.Join(pwd, "../../../test/fixtures"))
25+
os.Setenv("GOPATH", path.Join(pwd, "../../../test/fixtures/testdata"))
2626

2727
ccPackage, err := PackageGoLangCC("github.com")
2828
if err != nil {

pkg/fabric-client/packager/packager_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
Copyright SecureKey Technologies Inc. All Rights Reserved.
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
*/
16
package packager
27

38
import (
@@ -16,7 +21,7 @@ func TestPackageCC(t *testing.T) {
1621
if err != nil {
1722
t.Fatalf("error from os.Getwd %v", err)
1823
}
19-
os.Setenv("GOPATH", path.Join(pwd, "../../../test/fixtures"))
24+
os.Setenv("GOPATH", path.Join(pwd, "../../../test/fixtures/testdata"))
2025

2126
ccPackage, err := PackageCC("github.com", "")
2227
if err != nil {
@@ -69,7 +74,7 @@ func TestUndefinedPackageCC(t *testing.T) {
6974
if err != nil {
7075
t.Fatalf("error from os.Getwd %v", err)
7176
}
72-
os.Setenv("GOPATH", path.Join(pwd, "../../../test/fixtures"))
77+
os.Setenv("GOPATH", path.Join(pwd, "../../../test/fixtures/testdata"))
7378

7479
_, err = PackageCC("github.com", "UndefinedCCType")
7580
if err == nil {

test/fixtures/src/github.com/events_cc/events_cc.go renamed to test/fixtures/testdata/src/github.com/events_cc/events_cc.go

File renamed without changes.

test/fixtures/src/github.com/example_cc/example_cc.go renamed to test/fixtures/testdata/src/github.com/example_cc/example_cc.go

File renamed without changes.

test/fixtures/src/github.com/example_cc1/example_cc1.go renamed to test/fixtures/testdata/src/github.com/example_cc1/example_cc1.go

File renamed without changes.

test/integration/base_test_setup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func (setup *BaseSetupImpl) InstallCC(chainCodeID string, chainCodePath string,
202202
// GetDeployPath ..
203203
func (setup *BaseSetupImpl) GetDeployPath() string {
204204
pwd, _ := os.Getwd()
205-
return path.Join(pwd, "../fixtures")
205+
return path.Join(pwd, "../fixtures/testdata")
206206
}
207207

208208
// InstallAndInstantiateExampleCC ..

test/integration/orgs/test_setup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@ func installAndInstantiate(t *testing.T) {
137137

138138
orgTestClient.SetUserContext(org1AdminUser)
139139
admin.SendInstallCC(orgTestClient, "exampleCC",
140-
"github.com/example_cc", "0", nil, []fab.Peer{orgTestPeer0}, "../../fixtures")
140+
"github.com/example_cc", "0", nil, []fab.Peer{orgTestPeer0}, "../../fixtures/testdata")
141141

142142
orgTestClient.SetUserContext(org2AdminUser)
143143
err := admin.SendInstallCC(orgTestClient, "exampleCC",
144-
"github.com/example_cc", "0", nil, []fab.Peer{orgTestPeer1}, "../../fixtures")
144+
"github.com/example_cc", "0", nil, []fab.Peer{orgTestPeer1}, "../../fixtures/testdata")
145145
if err != nil {
146146
t.Fatal(err)
147147
}

test/scripts/check_license.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ if [[ -z "$CHECK" ]]; then
2222
fi
2323

2424
if [[ -z "$CHECK" ]]; then
25-
echo "All files are excluded from having SPDX-License-Identifier headers"
25+
echo "All files are excluded from having license headers"
2626
exit 0
2727
fi
2828

29-
echo "Checking committed files for SPDX-License-Identifier headers ..."
3029
missing=`echo "$CHECK" | xargs ls -d 2>/dev/null | xargs grep -L "SPDX-License-Identifier"`
3130
if [[ -z "$missing" ]]; then
3231
echo "All files have SPDX-License-Identifier headers"
@@ -37,4 +36,15 @@ echo "$missing"
3736
echo
3837
echo "Please replace the Apache license header comment text with:"
3938
echo "SPDX-License-Identifier: Apache-2.0"
39+
40+
echo
41+
echo "Checking committed files for traditional Apache License headers ..."
42+
missing=`echo "$missing" | xargs ls -d 2>/dev/null | xargs grep -L "http://www.apache.org/licenses/LICENSE-2.0"`
43+
if [[ -z "$missing" ]]; then
44+
echo "All remaining files have Apache 2.0 headers"
45+
exit 0
46+
fi
47+
echo "The following files are missing traditional Apache 2.0 headers:"
48+
echo "$missing"
49+
echo "Fatal Error - All files must have a license header"
4050
exit 1

0 commit comments

Comments
 (0)