From b2fd2d8433cf16f3a964113507b3901b3736ba7c Mon Sep 17 00:00:00 2001 From: Aleksey Stryukov Date: Fri, 7 Jul 2023 13:42:42 +0300 Subject: [PATCH] robottests in docker --- .env.example | 3 +++ .gitignore | 4 ++++ Dockerfile | 13 +++++++++++++ docker-compose.yml | 13 +++++++++++++ .../tests_files/aboveThreshold_keywords.robot | 2 +- op_robot_tests/tests_files/base_keywords.robot | 2 +- op_robot_tests/tests_files/keywords.robot | 2 +- requirements.txt | 9 +++++++++ 8 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 .env.example create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 requirements.txt diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..7c72835e --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +MODE=aboveThresholdUA + +ROBOT_OPTIONS="--loglevel DEBUG -s planning --exitonfailure" \ No newline at end of file diff --git a/.gitignore b/.gitignore index ced71813..b4689618 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,10 @@ __pycache__/ *.py[cod] +.env +artifact*.yaml +reports/ + # Distribution / packaging / buildout /*.egg-info/ /.installed.cfg diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..ff2ec3b4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM ppodgorsek/robot-framework:latest + +USER root +RUN dnf install -y git +COPY requirements.txt requirements.txt +RUN pip3 install --upgrade pip && pip install --no-cache-dir -r requirements.txt + +USER ${ROBOT_UID}:${ROBOT_GID} + + +COPY /op_robot_tests/tests_files /opt/robotframework/tests + +CMD ["sh","-c", "run-tests-in-virtual-screen.sh"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..8c718dc0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.8' + +services: + robot: + build: + context: . + dockerfile: Dockerfile + command: ["sh","-c", "run-tests-in-virtual-screen.sh"] + env_file: + - .env + volumes: + - ./op_robot_tests/tests_files:/opt/robotframework/tests + - ./reports:/opt/robotframework/reports diff --git a/op_robot_tests/tests_files/aboveThreshold_keywords.robot b/op_robot_tests/tests_files/aboveThreshold_keywords.robot index 43ec121f..b6d97b5b 100644 --- a/op_robot_tests/tests_files/aboveThreshold_keywords.robot +++ b/op_robot_tests/tests_files/aboveThreshold_keywords.robot @@ -1,5 +1,5 @@ *** Settings *** -Library ../tests_files/service_keywords.py +Library service_keywords.py Library Collections Resource keywords.robot Resource resource.robot diff --git a/op_robot_tests/tests_files/base_keywords.robot b/op_robot_tests/tests_files/base_keywords.robot index 37d49de4..18359662 100755 --- a/op_robot_tests/tests_files/base_keywords.robot +++ b/op_robot_tests/tests_files/base_keywords.robot @@ -1,6 +1,6 @@ coding: utf-8 *** Settings *** -Library ../tests_files/service_keywords.py +Library service_keywords.py Library Collections Resource keywords.robot Resource resource.robot diff --git a/op_robot_tests/tests_files/keywords.robot b/op_robot_tests/tests_files/keywords.robot index 8f6193df..1f97e928 100644 --- a/op_robot_tests/tests_files/keywords.robot +++ b/op_robot_tests/tests_files/keywords.robot @@ -1,6 +1,6 @@ coding: utf-8 *** Settings *** -Library ../tests_files/service_keywords.py +Library service_keywords.py Library String Library Collections Library SeleniumLibrary diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..5d125446 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +Faker>=18.9.0 +dpath==2.1.6 +robotframework-debuglibrary==2.3.0 +haversine==2.8.0 +jsonpath-rw==1.4.0 +munch==3.0.0 +webdriver-manager==3.8.6 +git+https://github.com/ProzorroUKR/barbecue.git@0.2#egg=barbecue +git+https://github.com/ProzorroUKR/openprocurement.client.python.git@upstream#egg=openprocurement_client \ No newline at end of file