github.com/0xPolygon/supernets2-node@v0.0.0-20230711153321-2fe574524eaa/docs/ci/opsman.md (about)

     1  # Test operations package
     2  
     3  We use the functionality provided by the [test operations package] in order to
     4  manage components used during tests, specially e2e.
     5  
     6  The main functionality used currently in the tests is related to managing
     7  containers, the package exposes the function `StartComponent` which takes a
     8  container name (as defined in the [docker compose file]) and a variadic parameter
     9  with a set of condition functions to check when the container can be considered
    10  as ready. So we can call it without any condition like:
    11  ```go
    12  operations.StartComponent("my-container")
    13  ```
    14  or adding readiness conditions as:
    15  ```go
    16  operations.StartComponent("my-container", func() (done bool, err error){
    17    // run some checks
    18    return true, nil
    19  }, func()(done bool, err error){
    20    // run some other checks
    21    return true, nil
    22  })
    23  ```
    24  
    25  [test operations package]: ../../test/operations/
    26  [docker compose file]: ../../docker-compose.yml