github.com/alibaba/sealer@v0.8.6-0.20220430115802-37a2bdaa8173/test/README.md (about)

     1  # About
     2  
     3  The code in this repository is a set of [Ginkgo](http://onsi.github.io/ginkgo)
     4  and [Gomega](http://onsi.github.io/gomega) based integration tests that execute commands using the sealer CLI.
     5  
     6  ## Prerequisites
     7  
     8  Before you run the tests, you'll need a sealer binary in your machine executable path . Follow the
     9  instructions [here](https://github.com/alibaba/sealer#readme) to get one.
    10  
    11  ## Run the Tests
    12  
    13  To run a single test or set of tests, you'll need the [Ginkgo](https://github.com/onsi/ginkgo) tool installed on your
    14  machine:
    15  
    16  ```console
    17  go get github.com/onsi/ginkgo/ginkgo
    18  ```
    19  
    20  To install Sealer and prepare the test environment:
    21  
    22  ```console
    23  #install Sealer binaries
    24  wget https://github.com/alibaba/sealer/releases/download/v0.8.5/sealer-v0.8.5-linux-amd64.tar.gz && \
    25  tar zxvf sealer-v0.8.5-linux-amd64.tar.gz && mv sealer /usr/bin
    26  
    27  #prepare test environment
    28  export ACCESSKEYID={your AK}
    29  export ACCESSKEYSECRET={your SK}
    30  export RegionID={your region}
    31  export REGISTRY_URL={your registry}
    32  export REGISTRY_USERNAME={user name}
    33  export REGISTRY_PASSWORD={password}
    34  #default test image name: registry.cn-qingdao.aliyuncs.com/sealer-io/kubernetes:v1.19.8
    35  export IMAGE_NAME={test image name}
    36  ```
    37  
    38  To execute the entire test suite:
    39  
    40  ```console
    41  cd sealer && ginkgo test
    42  ```
    43  
    44  You can then use the `--focus` option to run subsets of the test suite:
    45  
    46  ```console
    47  ginkgo --focus="sealer login" test
    48  ```
    49  
    50  You can then use the `-v` option to print out default reporter as all specs begin:
    51  
    52  ```console
    53  ginkgo -v test
    54  ```
    55  
    56  More ginkgo helpful info see:
    57  
    58  ```console
    59  ginkgo --help
    60  ```