From eb6ac6091c73120220e7ef55af0beba8a7701b23 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 20 Jun 2022 10:35:28 +0200 Subject: [PATCH] feat: add robot framework CI --- .github/workflows/robot.yml | 34 ++++++++++++++++++++++++++++++++ back/test/robot/pyproject.toml | 4 ++++ back/test/robot/requirements.txt | 2 ++ back/test/robot/rest.resource | 4 ++++ 4 files changed, 44 insertions(+) create mode 100644 .github/workflows/robot.yml create mode 100644 back/test/robot/pyproject.toml create mode 100644 back/test/robot/requirements.txt create mode 100644 back/test/robot/rest.resource diff --git a/.github/workflows/robot.yml b/.github/workflows/robot.yml new file mode 100644 index 0000000..e581a23 --- /dev/null +++ b/.github/workflows/robot.yml @@ -0,0 +1,34 @@ +name: RobotTests +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + runs-on: ubuntu-latest + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + + - name: Build the app + run: docker-compose build + + - name: Start the service + run: docker-compose up -d + + - name: Perform healthchecks + run: | + docker-compose ps -a + wget --retry-connrefused http://localhost:3000 # /healthcheck + + - name: Run robot tests + run: | + pip install -r back/tests/robot/requirements.txt + robot -d out back/tests/robot/ + + - uses: actions/upload-artifact@v2 + with: + name: results + path: out + diff --git a/back/test/robot/pyproject.toml b/back/test/robot/pyproject.toml new file mode 100644 index 0000000..e5e1011 --- /dev/null +++ b/back/test/robot/pyproject.toml @@ -0,0 +1,4 @@ +[tool.robotidy] +configure = [ + "MergeAndOrderSections:order=comments,settings,keywords,variables,testcases" +] diff --git a/back/test/robot/requirements.txt b/back/test/robot/requirements.txt new file mode 100644 index 0000000..f9abbc7 --- /dev/null +++ b/back/test/robot/requirements.txt @@ -0,0 +1,2 @@ +robotframework +RESTinstance diff --git a/back/test/robot/rest.resource b/back/test/robot/rest.resource new file mode 100644 index 0000000..41db3c9 --- /dev/null +++ b/back/test/robot/rest.resource @@ -0,0 +1,4 @@ +*** Settings *** +Documentation Common things to handle rest requests + +Library REST http://localhost:3000/api