hyperledger-archives / fabric

THIS IS A READ-ONLY historic repository. Current development is at https://gerrit.hyperledger.org/r/#/admin/projects/fabric . pull requests not accepted
https://gerrit.hyperledger.org/
Apache License 2.0
1.17k stars 1.01k forks source link

DOC : Installation 3.3 Behave Tests - 'make images' is referenced but not defined in this doc #1511

Open jjjjibm opened 8 years ago

jjjjibm commented 8 years ago

Description

Testing the revised installation document here: https://github.com/hyperledger/fabric/blob/master/docs/dev-setup/install.md

In step 3.3 Behave Tests, it says: Note, in order to run behave directly, you must run 'make images' first to build the necessary peer and member services docker images.

However, no instructions are given to run 'make images'. If it is simply the command 'make images', why not put it here: cd $GOPATH/src/github.com/hyperledger/fabric make images make behave

You'll have to ask development if that is a valid command sequence.

The page used to say run the unit tests in section 3.1 first. I had a chat with Greg Haskins about it, and he may be appropriate to resolve this issue:

jjjjibm [5:28 PM] I hear tell you wrote the makefile for the behave test cases as documented here: https://github.com/hyperledger/fabric/blob/master/docs/dev-setup/install.md ?

GitHub hyperledger/fabric fabric - Fabric is a blockchain project in Incubation proposed to the community and documented at https://goo.gl/RYQZ5N. Information on what Incubation entails can be found in the Hyperledger Proj...

Gregory Haskins [5:29 PM] that would be a bit of an overstatement, heh, but yes

[5:29] the makefile just launches the behave test with a one-liner

[5:29] the real work is done outside of make

[5:30] seeing a problem?

jjjjibm [5:30 PM] yes. Here is the documenation for 'behave' ...

[5:30] 3.3 Behave Tests

Behave tests will setup networks of peers with different security and consensus configurations and verify that transactions run properly. To run these tests

cd $GOPATH/src/github.com/hyperledger/fabric make behave

Some of the Behave tests run inside Docker containers. If a test fails and you want to have the logs from the Docker containers, run the tests with this option

behave -D logs=Y

Note, in order to run behave directly, you must run 'make images' first to build the necessary peer and member services docker images.

[5:31] Notice it says to run 'make images' first, a step which is not described on the page

[5:31] I reckoned it meant to say run 'make unit-test' as described here:

[5:31] 3.1 Go Unit Tests

Use the following sequence to run all unit tests

cd $GOPATH/src/github.com/hyperledger/fabric make unit-test

Gregory Haskins [5:31 PM] well, i think it does say what I meant, but it might need to be reworded

[5:32] “images” is a pre-requisite of “make behave”, so if you followed the first steps its done for you

jjjjibm [5:32 PM] I got this error twice:

[5:32] com/hyperledger/fabric$ make behave cd peer; CGO_CFLAGS=" " CGO_LDFLAGS="-lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" go build go install github.com/hyperledger/fabric/peer: open peer: text file busy make: *\ [peer] Error 1 vagrant@hyperledger-devenv:v0.0.9-5cd67fd:/opt/gopath/src/github.com/hyperledger/fabric$

Gregory Haskins [5:32 PM] what i was trying to say was “if you want to run behave on your own, thats cool, but make sure you build the pre-requisites yourself with ‘make images'

jjjjibm [5:32 PM] Right before trying make behave, I ran make unit-test which seems to run ok

[5:33] except for one timeout

Gregory Haskins [5:33 PM] ive not seen that error before, but from the report it seems like perhaps you have a peer still running?

jjjjibm [5:33 PM] I do ... it's never made a difference before. Should I cancel the peer and try again?

Gregory Haskins [5:33 PM] it seems that way

[5:34] i suspect its because make it trying to satisify the prereq and you ahve it running

[5:34] prior, there was no make file so no rebuild would have been attempted

[5:34] now, whether the rebuild is the right thing to do is another matter, heh

jjjjibm [5:34 PM] AFter cancelling peer:

[5:34] com/hyperledger/fabric$ make behave cd peer; CGO_CFLAGS=" " CGO_LDFLAGS="-lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" go build Running behave tests Feature: lanching 3 peers # peer_basic.feature:11 As a HyperLedger developer I want to be able to launch 3 peers Scenario: Peers list test, single peer issue #827 # peer_basic.feature:16 Given we compose "docker-compose-1.yml" # steps/peer_basic_impl.py:121

Gregory Haskins [5:35 PM] right now, its overly conservative and assumes we should always rebuild the peer

[5:35] ill see if I can make it smarter

jjjjibm [5:35 PM] So, what words need to go into my issue against the doc? That 'make images' appearing out of nowhere? Could I have simply typed 'make images' before typing 'make behave'?

Gregory Haskins [5:35 PM] for the time being, workaround is dont leave a peer running

jjjjibm [5:35 PM] yeah, I have a problem with that. The doc doesn't remind you to cancel the peer

Gregory Haskins [5:36 PM] yes, you could have done “make images behave”, it just would be redundant

[5:36] make behave is a superset with images

jjjjibm [5:36 PM] I was thinking 'make images' 'make behave'

Gregory Haskins [5:36 PM] note that its always been a prerequisite to stop the peer before running behave though, make didnt change that

[5:37] there is no functional difference between the two (make images; make behave == make images behave)

jjjjibm [5:37 PM] Now I'm confused. The web page says to run 'make images' first?

Gregory Haskins [5:37 PM] in fact, you could add “make behave” to that tuple since images is implied

[5:37] oh, let me look

jjjjibm [5:37 PM] Ok

Gregory Haskins [5:38 PM] im not seeing that

[5:38] theres three occurances of “images” and they are all in the note about running behave by hand

[5:39] am i missing some?

jjjjibm [5:39 PM] Look for this on the page:

[5:39] Note, in order to run behave directly, you must run 'make images' first to build the necessary peer and member services docker images.

Gregory Haskins [5:39 PM] yep, those are the three I see

jjjjibm [5:39 PM] As far as I can tell, that's the first reference to 'make images'

[5:40] YOu just said (I think) I DON'T need to type 'make images' but the page says type 'make images'

Gregory Haskins [5:40 PM] ok, theres two things going on here

[5:40] 1) full automated mode, aka “make behave”….for this mode, no, you dont need to run make images

[5:41] 2) manual mode, where you launch behave yourself…for this mode, you need to ensure that you run “make images” prior to running behave yourself

jjjjibm [5:41 PM] Ah, I thought 'run behave directly' meant run it first thing :slightly_smiling_face: not run outside of make

[5:42] first thing as oppposed to running unit-tests first

Gregory Haskins [5:42 PM] right, and if that isnt clear we should fix the doc

jjjjibm [5:42 PM] Is running make unit-test now optional/not required?

Gregory Haskins [5:42 PM] yeah, if you run unit-tests, that also builds the images

[5:43] correct, to run behave, you can run the “make images”, or “make unit-tests” which also runs “make images” for you

jjjjibm [5:43 PM] Ok. I am going to gut issue 1511 and paste this chat into it!

Gregory Haskins [5:43 PM] ok

jjjjibm [5:43 PM] Because it brings up more nuances of the problem.

[5:43] Thanks!

Gregory Haskins [5:44 PM] ok, apologies for any grief this caused…it was a find/replace edit of the old instructions so maybe some nuance was lost in translation

jjjjibm [5:44 PM] That's why we test :slightly_smiling_face:

cophey commented 8 years ago

I 'make images behave',got errors: make: Nothing to be done forimages'. cd peer; CGO_CFLAGS=" " CGO_LDFLAGS="-lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" go build Running behave tests /bin/sh: 1: behave: not found make: *\ [behave] Error 127`

GrapeBaBa commented 8 years ago

@cophey It seems now 'make behave' will build images automatic in my local, could you try 'make behave' directly?

cophey commented 8 years ago

@GrapeBaBa There is some worng with my environment.There is no pip and behave command.I install manually,and then i try again.thanks anyway.