How to run the integration tests

For each supported hoster, SCM Backup needs to:

  • make API calls to get a list of repositories
  • use Git/Mercurial etc. to clone repositories

So there are integration tests for each hoster which do these things as well, some of them with authentication.

We created test users especially for these tests (for example: user and organization used for GitHub integration tests ), but of course we can’t publish their passwords.

So in order to run any of these integration tests, you need to setup your own test users and private test repositories.

SCM Backup’s integration tests read the users, passwords etc. from a file named environment-variables.ps1 in the main project directory, which is not in the repository.

You need to create your own by copying/renaming environment-variables.ps1.sample, and changing the values.

The public repositories are hardcoded in the tests, the tests just authenticate with the user/password from the environment variables.

xUnit.Net Cheat Sheet

Running a single test

Edit run-all-tests.ps1, look for the INTEGRATION TESTS section and add the --filter parameter to the dotnet test call, like this:

--filter "FullyQualifiedName=ScmBackup.Tests.Integration.Hosters.BitbucketBackupMercurialTests.MakesBackup"