Lab 10.1: Chaincode Unit Testing with MockStub -
Hello,
In the Lab 10.1: Chaincode Unit Testing with MockStub,
when I want to start the unit test command, I've got :
_go: cannot find main module, but found .git/config in /Users/xxx/go/src/github.com/hyperledger/fabric-samples
to create a module there, run:
cd ../.. && go mod init
_
It is normal?
Here is my go env result:
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/christophe.charles/Library/Caches/go-build"
GOENV="/Users/christophe.charles/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/christophe.charles/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/christophe.charles/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.16.2/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.16.2/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.2"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/f9/lq3l8rtn6szdqgq0nqmg2b080000gn/T/go-build1797718618=/tmp/go-build -gno-record-gcc-switches -fno-common"
How can I solve this problem ?
Thanks ![]()
BR
Comments
-
@christophe.charles , Hello and welcome to the forum . Please provide more information as to what command was issued before you received the error message. The labs execute specific scenarios that need to be completed in the correct order. If you run into trouble it is suggested you re-do the lab from where you received the error. Hope this helps. Keep on learning!
Bobbi0 -
Hello @Bobbijn
Thank for your answer.But, as shown on page 56, I ran the simple_chaincode_test.go file test with min IDE (Intellij).
And the test is ok!
But when I try to run the same test, in a terminal, the test is KO!
0 -
@christophe.charles, Hello, In this lab, a mock implementation for ChaincodeStubInterface is needed to run any tests. When testing in a terminal, some of the configurations may not work outside the lab environment. If you would like to learn more on this topic, please join the The Hyperledger Fabric Private Chaincode Working Group meetings, all are welcome to attend. https://wiki.hyperledger.org/display/fabric/Hyperledger+Fabric+Private+Chaincode . Keep learning, Bobbi
0 -
Thank you Bobbi ;-)
BR0
Categories
- All Categories
- 177 LFX Mentorship
- 177 LFX Mentorship: Linux Kernel
- 750 Linux Foundation IT Professional Programs
- 373 Cloud Engineer IT Professional Program
- 169 Advanced Cloud Engineer IT Professional Program
- 74 DevOps IT Professional Program - Discontinued
- 4 DevOps & GitOps IT Professional Program
- 99 Cloud Native Developer IT Professional Program
- 7.6K Training Courses & Learning Paths
- 1 AI & ML Training
- 1 Blockchain & Decentralized Identity Training
- 5 Cloud & Containers Training
- 1 Cybersecurity Training
- 2 DevOps & Site-Reliability Training
- 1 Linux Kernel Development Training
- 1 Networking Training
- 2 Open Source Best Practice Training
- 1 System Administration Training
- 1 System Engineering Training
- 1 Web & Application Development Training
- 792 Hardware
- 202 Drivers
- 68 I/O Devices
- 37 Monitors
- 95 Multimedia
- 173 Networking
- 91 Printers & Scanners
- 87 Storage
- 769 Linux Distributions
- 81 Debian
- 68 Fedora
- 22 Linux Mint
- 13 Mageia
- 24 openSUSE
- 150 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 356 Ubuntu
- 465 Linux System Administration
- 31 Cloud Computing
- 73 Command Line/Scripting
- Github systems admin projects
- 98 Linux Security
- 78 Network Management
- 101 System Management
- 46 Web Management
- 106 Mobile Computing
- 18 Android
- 73 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 392 Off Topic
- 121 Introductions
- 181 Small Talk
- 29 Study Material
- 955 Programming and Development
- 310 Kernel Development
- 627 Software Development
- 984 Software
- 376 Applications
- 182 Command Line
- 5 Compiling/Installing
- 68 Games
- 317 Installation
- Archived
- 2 LFD140 Class Forum
- 1.4K LFS258 Class Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)
