Skip to content

Commit

Permalink
[FAB-6146] Move fixture chaincode under testdata
Browse files Browse the repository at this point in the history
Change-Id: I5ef9a7e8dcb34b2d428da183312651c16e71482d
Signed-off-by: Troy Ronda <troy@troyronda.com>
  • Loading branch information
troyronda committed Sep 13, 2017
1 parent a102eb3 commit dab5a98
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/fabric-client/packager/golang_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestPackageGoLangCC(t *testing.T) {
if err != nil {
t.Fatalf("error from os.Getwd %v", err)
}
os.Setenv("GOPATH", path.Join(pwd, "../../../test/fixtures"))
os.Setenv("GOPATH", path.Join(pwd, "../../../test/fixtures/testdata"))

ccPackage, err := PackageGoLangCC("github.com")
if err != nil {
Expand Down
9 changes: 7 additions & 2 deletions pkg/fabric-client/packager/packager_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package packager

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

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

_, err = PackageCC("github.com", "UndefinedCCType")
if err == nil {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/base_test_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (setup *BaseSetupImpl) InstallCC(chainCodeID string, chainCodePath string,
// GetDeployPath ..
func (setup *BaseSetupImpl) GetDeployPath() string {
pwd, _ := os.Getwd()
return path.Join(pwd, "../fixtures")
return path.Join(pwd, "../fixtures/testdata")
}

// InstallAndInstantiateExampleCC ..
Expand Down
4 changes: 2 additions & 2 deletions test/integration/orgs/test_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ func installAndInstantiate(t *testing.T) {

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

orgTestClient.SetUserContext(org2AdminUser)
err := admin.SendInstallCC(orgTestClient, "exampleCC",
"github.com/example_cc", "0", nil, []fab.Peer{orgTestPeer1}, "../../fixtures")
"github.com/example_cc", "0", nil, []fab.Peer{orgTestPeer1}, "../../fixtures/testdata")
if err != nil {
t.Fatal(err)
}
Expand Down
14 changes: 12 additions & 2 deletions test/scripts/check_license.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ if [[ -z "$CHECK" ]]; then
fi

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

echo "Checking committed files for SPDX-License-Identifier headers ..."
missing=`echo "$CHECK" | xargs ls -d 2>/dev/null | xargs grep -L "SPDX-License-Identifier"`
if [[ -z "$missing" ]]; then
echo "All files have SPDX-License-Identifier headers"
Expand All @@ -37,4 +36,15 @@ echo "$missing"
echo
echo "Please replace the Apache license header comment text with:"
echo "SPDX-License-Identifier: Apache-2.0"

echo
echo "Checking committed files for traditional Apache License headers ..."
missing=`echo "$missing" | xargs ls -d 2>/dev/null | xargs grep -L "http://www.apache.org/licenses/LICENSE-2.0"`
if [[ -z "$missing" ]]; then
echo "All remaining files have Apache 2.0 headers"
exit 0
fi
echo "The following files are missing traditional Apache 2.0 headers:"
echo "$missing"
echo "Fatal Error - All files must have a license header"
exit 1

0 comments on commit dab5a98

Please sign in to comment.