Skip to content

Geosoft2/TestRepo

 
 

Repository files navigation

TestRepo

Testconception

The listed tests, except for JS- and R-Client, have only been developed by using github actions. A local execution of single test classes only took place on a limited scale, so just the correct execution of tests via the github actions can be guaranteed. Although there should not be a general problem, when trying to set up these test scenarios locally with the given data in this repository or with dynamically generated data within the actions. For setting up JS- and R-Client testscenarios locally, follow instructions below.

Test Environment:

pytest is used as a testing framework

Test data:

  • Testdata for the unittests is provided by the development teams that wrote the tests
  • Testdata for the end-to-end tests is located within the python scripts for checking SST and NDVI/SENTINEL processes.
  • Testdata for the backend-validator is located in the BackendValidator directory in this repository in json-format.

Test Classes

Unittests

  • The repositories of the Microservices (submodules of this repository) contain test folders with Python-Files, which include Unittests
    • These commands can be executed using the command pytest
    • Unittests are written by the responsible developerteams and are only checked and optimized by the testing team

End-to-end tests

  • End-to-end Tests run with docker-compose and test the communication between microservices by executing multiple HTTP-Requests to different endpoints of multiple services
    • e2e-Tests are written by the testing team and are deployed in the TestRepo in e2e_ndvi.py and e2e_sst.py
    • Downloaded files, for both NDVI and SST cases, are copied from the database containers subdirectories to the actions running machine. Then, two test files, xr_ndvi and xr_sst, are executed, that check the downloaded files for correctness.

OpenEO Backend-Validator

The OpenEO Backend-Validator can be used to assess the Open-EO conformity of our Backend by referring to a dynamically by the action created config.json.

JS- and R-Client tests

In order to check, if the backend is able to communicate with JS- and R-environments, the openEO JS-Client and the openEO R-Client have been developed. These have been included into our test-environment.

Github Actions

  • The test methods listed above are integrated in Continuous Integration through Github Actions

  • As a Linting-Tool we use flake8 to check for correct Python Syntax

  • The Unittest-Workflow runs by schedule three times a day, as well as on certain events like pull-requests

    • The Unittest-Workflow depends on the Update-Submodules Workflow, which ensures that all submodules are up to date and the latest requirements can be installed
    • The Unittest-Workflow also hands back a coverage report regarding the Testcoverage by using the pytest-plugin pytest-cov
    • If the Unittest-Workflow fails, the responsible development teams receive an email, so that they can fix the problem that occured
  • In the End to End Workflow End-to-End Tests are executed

    • In addition to the end to end tests that cover the final implementation, we also provided end to end tests based on the implementation of demo 5
  • In the Backend-Validator Workflow the openEO backend validator is installed and tests for openEO Conformity by schedule three times a day as well

    • If the Backend-Validator workflow fails, the responsible developer teams receive an email, so that they can fix the problem that occured
  • In the R-Client Workflow a connection to our backend is established using the openEO R-Client. Additionally a test suite is executed.

  • In the JS-Client Workflow a connection to our backend is established using the openEO JS-Client. A js-script checks for the correct number of collections and processes provided by the backend.

R Client

  • In order to connect to our Backend with the openEO R-Client locally, please follow these Instructions:
    1. Execute the command git clone https://github.com/GeoSoftII2020-21/TestRepo
    2. Execute the command docker-compose up
    3. In RStudio or RConsole execute this Skript, which also contains a Test Suite

JS Client

  • In order to connect to our Backend with the openEO JS-Client locally, please follow these Instructions:
    1. Execute the command git clone https://github.com/GeoSoftII2020-21/TestRepo
    2. Execute the command docker-compose up
    3. Navigate into the js-client folder
    4. Open the html file. After 5 seconds you will be able to see the evaluated test results.

Test environment

  • For the R-Client testthat is used as a testing framework
  • For the JS-Client QUnit is used as a testing framework

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 62.3%
  • R 18.6%
  • JavaScript 16.5%
  • HTML 2.6%