Azure / azure-documentdb-datamigrationtool

Azure DocumentDB Data Migration Tool
MIT License
388 stars 182 forks source link

Get all tests running #158

Closed seesharprun closed 2 years ago

seesharprun commented 2 years ago

In response to #156, this PR is an attempt to get all tests running in the project.

The tests are broken down into two categories:

Functional tests

These tests required you to configure connection strings to run. This is not a great experience for a new developer forking the project for the first time. The tests also used a TestSettings file that is:

To fix this, I removed the dependency on the solution-level TestSettings file and added a .runsettings file to each functional test project. By default, this file is configured with a blank value for each connection string. If the test runner detects a blank connection string, it will mark the test as inconclusive and skip the test.

image

If the test runner detects a connection string, it will attempt to run the test.

image

⚠️ There are a few functional tests that are failing due to various issues. They include:

  • Multiple functional tests in the DocumentDb project with a DLL reference issue
  • A single functional test in the DocumentDb project with a regression bug
  • Various functional tests in the SQL project with regression bugs
  • Two functional tests in the DynamoDb project with regression bugs

image

⚠️ There are two function tests that I could not verify due to not be able to setup a dev environment. They include:

  • RavenDb: The official container images on DockerHub are for versions 4+. The client is configured for version 3. I was unable to validate that these tests are actually functioning correctly.
  • HBase: I attempted to create a Dockerfile for this, but ran into multiple issues with keeping the container running.

Unit tests

Originally, these tests required a TestSettings file with connection strings to run. This shouldn't be a blocker, so I removed that requirement so that the unit tests can run immediately after you fork or clone the repository.

Documentation

This PR also includes a tests.md with documentation on the tests, and examples of how to run each functional test package.

Looking forward

Wouldn't it be nice if we created a .devcontainer file with all of the functional tests passing at launch? Just a nice thought for a future PR after this.

seesharprun commented 2 years ago

I just finished getting all of the unit tests running, and correctly skipping the functional tests for projects that require connection strings. I was able to validate all of these functional tests projects against development databases using the instructions in the test.md file:

I was unable to validate these functional test projects:

image