Commit 0582dd50 authored by Thomas Boni's avatar Thomas Boni
Browse files

fix(venom): fix job structure

parent a91243ef
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
# Changelog
All notable changes to this job will be documented in this file.

## [0.1.0] - 2022-08-10
* Initial version
+15 −22
Original line number Diff line number Diff line
## Objective

This job manages and runs your integration tests with efficiency thanks to executors and assertions. Please, check the [Venom documentation](https://github.com/ovh/venom#readme){:target="_blank"}, if you want to learn more about the tool.
Runs your [Venom](https://github.com/ovh/venom) tests

## How to use it

1. Write your test suite for Venom and specified the path to the test file with the `VENOM_TESTS` variable. Check the [documentation](https://github.com/ovh/venom#testsuites){:target="_blank"} to learn more about test suite.
1. Add this job URL inside the `include` list of your `.gitlab-ci.yml` file (see the [quick setup](/use-the-hub/#quick-setup)). You can specify [a fixed version](#changelog) instead of `latest`.
    ```yaml
      - remote: 'https://jobs.r2devops.io/latest/venom.yml'
    ```
1. Write your test suite for Venom and specified the path to the test file with the `VENOM_TESTS` variable. Check the [documentation](https://github.com/ovh/venom#testsuites){:target="_blank"}.
1. Copy/paste job URL in `include` list of your `.gitlab-ci.yml` (see the [quick setup](https://docs.r2devops.io/get-started-use-the-hub/#quick-setup)). You can specify a fixed version instead of `latest`.
1. If you need to customize the job (stage, variables, ...) 👉 check the [jobs
   customization](/use-the-hub/#jobs-customization)
   customization](https://docs.r2devops.io/get-started-use-the-hub/#jobs-customization)
1. Well done, your job is ready to work ! 😀

## Job details

* Job name: `venom`
* Docker image:
[`golang:1.17.6-buster`](https://hub.docker.com/r/_/golang){:target="_blank"}
* Default stage: `static_tests`
* When: `always`

### Variables

| Name | Description                                                                                                                                                                       | Default |
| ---- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------|
| `PROJECT_ROOT` <img width=100/> | Relative path in your repository to your project. <img width=175/>                                                                                                                | `.` <img width=100/>     |
| `VENOM_VERSION` <img width=100/> | The Venom version to install and execute. <img width=175/>                                                                                                                        | `1.0.1` <img width=100/> |
| `VENOM_TESTS` <img width=100/> | Relative path to a single `yml` file which contains your test suite. <img width=175/>                                                                                             | ` ` <img width=100/>     |
| `REPORT_FORMAT` <img width=100/> | Format of the Venom report, available formats are  JUnit (xml), json, yaml and tap. <img width=175/>                                                                              | `xml` <img width=100/>   |
| `OUTPUT_DIRECTORY` <img width=100/> | Directory path to the Venom reports output. <img width=175/>                                                                                                                      | `dist` <img width=100/>  |
| `ADDITIONAL_OPTIONS` <img width=100/> | Possibility to add [more options](https://github.com/ovh/venom#executors){:target="_blank"} into the Venom command, like changing the default executor and more. <img width=175/> | ` ` <img width=100/>     |
| ---- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| `PROJECT_ROOT` | Relative path in your repository to your project.                                                                                                                       | `.`     |
| `VENOM_VERSION` | The Venom version to install and execute.                                                                                                                              | `1.0.1` |
| `VENOM_TESTS` | Relative path to a single `yml` file which contains your test suite.                                                                                                     | ` `     |
| `REPORT_FORMAT` | Format of the Venom report, available formats are  JUnit (xml), json, yaml and tap.                                                                                    | `xml`   |
| `OUTPUT_DIRECTORY` | Directory path to the Venom reports output.                                                                                                                         | `dist`  |
| `ADDITIONAL_OPTIONS` | Possibility to add [more options](https://github.com/ovh/venom#executors){:target="_blank"} into the Venom command, like changing the default executor and more.  | ` `     |

## Author

This resource is an **[official job](https://docs.r2devops.io/faq-labels/)** added in [**R2Devops repository**](https://gitlab.com/r2devops/hub) by [@valentin.guyon.vg](https://gitlab.com/valentin.guyon.vg)

jobs/venom/job.yml

deleted100644 → 0
+0 −13
Original line number Diff line number Diff line
name: venom
description: This job manages and runs your integration tests with efficiency thanks to executors and assertions.
default_stage: static_tests
icon: 🐍
maintainer: valentin.guyon.vg
license: Apache-2.0
images:
  "golang": "1.17.6-buster"
tools:
labels:
  - Tests
  - Utilities
  - Quality

jobs/venom/screenshots/.gitkeep

deleted100644 → 0
+0 −0

Empty file deleted.

+3 −5
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ stages:
venom:

  image:
    name: golang:1.17.6-buster
    name: golang:${IMAGE_TAG}
    entrypoint: [""]

  stage: static_tests
@@ -18,6 +18,7 @@ venom:
    REPORT_FORMAT: "xml"
    OUTPUT_DIRECTORY: "dist"
    ADDITIONAL_OPTIONS: ""
    IMAGE_TAG: "1.17.6-buster"

  script:
    - if [[ ${VENOM_TESTS} = "" ]]; then
@@ -30,9 +31,6 @@ venom:
    - ./venom.linux-amd64 run ${VENOM_TESTS} --format=${REPORT_FORMAT} --output-dir=${OUTPUT_DIRECTORY} ${ADDITIONAL_OPTIONS}

  artifacts:
    reports:
      junit: ${OUTPUT_DIRECTORY}/*.xml
    when: always
    paths:
      - ${CI_PROJECT_DIR}/${OUTPUT_DIRECTORY}
    when: always
    expire_in: 30 days
Loading