github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/libnetwork/test/integration/README.md (about)

     1  # LibNetwork Integration Tests
     2  
     3  Integration tests provide end-to-end testing of LibNetwork and Drivers.
     4  
     5  While unit tests verify the code is working as expected by relying on mocks and
     6  artificially created fixtures, integration tests actually use real docker
     7  engines and communicate to it through the CLI.
     8  
     9  Note that integration tests do **not** replace unit tests and Docker is used as a good use-case.
    10  
    11  As a rule of thumb, code should be tested thoroughly with unit tests.
    12  Integration tests on the other hand are meant to test a specific feature end to end.
    13  
    14  Integration tests are written in *bash* using the
    15  [bats](https://github.com/sstephenson/bats) framework.
    16  
    17  ## Pre-Requisites
    18  
    19  1. Bats (https://github.com/sstephenson/bats#installing-bats-from-source)
    20  2. Docker Machine (https://github.com/docker/machine)
    21  3. Virtualbox (as a Docker machine driver)
    22  
    23  ## Running integration tests
    24  
    25  * Start by [installing] (https://github.com/sstephenson/bats#installing-bats-from-source) *bats* on your system.
    26  * If not done already, [install](https://docs.docker.com/machine/) *docker-machine* into /usr/bin
    27  * Make sure Virtualbox is installed as well, which will be used by docker-machine as a driver to launch VMs
    28  
    29  In order to run all integration tests, pass *bats* the test path:
    30  ```
    31  $ bats test/integration/daemon-configs.bats
    32  ```
    33  
    34