Skip to content
samatrhea edited this page May 13, 2024 · 7 revisions

Tools

Environment Setup

We are going to use a docker image to execute the integration test suite against, this docker image contains a PostgreSQL server. For each integration test suite the data set is restored. To make sure this does not take too long, the data is not stored to disk but to a so-called RAM disk. The consequence of this is that when the docker container is stopped, the data is lost.

Docker Setup

  • Pull the Docker image: docker pull rheagroup/cdp4-test-database-community-edition:1.3.1
  • Create the CDP4 docker network: docker network create cdp4
  • Start the docker container: docker run -p 5432:5432 --tmpfs /var/lib/postgresql/data:rw -it -d --name cdp4-test-database-community-edition --net cdp4 rheagroup/cdp4-test-database-community-edition:1.3.1

CDP4® Services

The purpose of the integration test suite is to test the CDP4® Services. Therefore we must make sure to start them. Make sure that the URL of the database is known to the CDP4® Services by updating the CDP4WebServices.API/config_debug.json file of the CDP4® Services project.

⚠️ The updated settings file should not be committed to the git repository

  • start Visual Studio as Administrator
  • update the CDP4WebServices.API/config_test.json file of the CDP4® Services
    • ensure Backtier.HostName points to your locally running database instance
    • ensure Backtier.IsDbSeedEnabled is set to true
    • ensure Backtier.IsDbRestoreEnabled is set to true
    • ensure Changelog.CollectChanges is set to true
  • Rebuild the solution in Test mode in case you want to debug them while the tests are running
  • Start the services from Visual Studio (F5)

Seed test data

Before the test suite can be executed the test data needs to be seeded. This is done by POSTing the test-data Annex C.3 zip archive to the database via the CDP4® Services.

  • Make sure the cdp4-test-database-community-edition docker container is running
  • Get the latest version of the test data set using git fetch and git pull
  • Create a zip archive from the test data set
  • curl --form file=@"Data.zip" http://localhost:5000/Data/Exchange

Execute Integration test suite

⚠️ The updated settings file should not be committed to the git repository

  • Open the integration test solution using Visual Studio 2019
  • Make sure that the integration test suite settings connect to your local instance by updating the settings.json file
  • run all the tests and verify that all tests are passing
Clone this wiki locally