github.com/GoogleContainerTools/skaffold@v1.39.18/examples/custom-tests/README.md (about)

     1  ### Example: Running custom tests on built images
     2  
     3  [![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https://github.com/GoogleContainerTools/skaffold&cloudshell_open_in_editor=README.md&cloudshell_workspace=examples/custom-tests)
     4  
     5  This example shows how to run _custom tests_ on newly built images in the skaffold dev loop. 
     6  
     7  Custom tests are associated with single image artifacts. When test dependencies change, no build will happen but tests would get re-run. Tests are configured in the `skaffold.yaml` in the `test` stanza, e.g.
     8  
     9  ```yaml
    10  test:
    11      - image: skaffold-example
    12        custom:
    13        - command: <command>
    14          timeoutSeconds: <timeout in seconds>
    15          dependencies: <dependencies for this command>
    16            paths: <file dependencies>
    17            - <paths glob>
    18  ```
    19  
    20  As tests take time, you might prefer to configure tests using [profiles](https://skaffold.dev/docs/environment/profiles/) so that they can be automatically enabled or disabled, e.g.
    21  If the `command` exits with a non-zero return code then the test will have failed, and deployment will not continue.
    22  
    23  ```yaml
    24  profiles:
    25    - name: test
    26      test:
    27      - image: skaffold-example
    28        custom:
    29          - command: <command>
    30            timeoutSeconds: <timeout in seconds>
    31            dependencies: <dependencies for this command>
    32              paths: <file dependencies>
    33              - <paths glob>
    34  ```