github.com/go-chef/chef@v0.30.1/testapi/README.md (about)

     1  # Examples for using the api
     2  
     3  ## Coded samples
     4  The cmd directory has examples of using the client code to exercise the chef api end points.
     5  The bin directory has commands for invoking the code.
     6  The inspec directory has inspec tests to verify the output from invoking the code.
     7  The chefapi_examples cookbook creates a chef server instance. Test kitchen can run the sample code and verify
     8  the resulting output using inspec tests.
     9  
    10  ## Cookbook and kitchen testing
    11  Run kitchen converge to create a chef server instance in a linux image running under vagrant.
    12  Run kitchen verify to run the go examples using the client api and to confirm
    13  that the results are as expected.
    14  
    15  ## Looking at the output from an api call
    16  Sometimes you might want to see what output gets created by an api call.  Inspec tends to hide
    17  and mask the output. You can use kitchen login to access the linux image. Use "cd /go/src/testapi/bin"
    18  to access the bin directory and run any of the commands to run the api sample use code and see
    19  the results. Running the bin commands by adding the -tags debug option will show more detail.
    20  
    21  ## Creating a client
    22  On the test image /go/src/github.com/go-chef/chef/testapi/testapi.go has code that creates a client
    23  for use by other api calls. For the purposes of testing it uses the pivotal user and key
    24  for all the tests.