Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(test): Add Testcontainers for Radarr and Sonarr integration testing #11

Merged
merged 24 commits into from
Aug 2, 2024

Conversation

maxnatamo
Copy link
Collaborator

Overview

Adds testing layers and fixtures for testing against real Radarr and Sonarr instances, using Testcontainers and Docker.

This allows for end-to-end testing of adding/removing items from *arr instances. A small integration example:

namespace Fetcharr.SomeIntegrationTests
{
    [IntegrationTest]
    [Collection(nameof(RadarrIntegrationLayer))]
    public class RadarrIntegrationTests(
        RadarrIntegrationLayer layer)
    {
        [Fact]
        public async Task AssertHealthyRadarrInstance()
        {
            // Arrange

            // Act
            IFlurlResponse response = await layer.RadarrApiClient.Request("/api/v3/health").GetAsync();

            // Assert
            response.StatusCode.Should().Be(200);
        }
    }
}

PR Checklist

  • Successful Docker build (docker buildx build .)

@github-actions github-actions bot added the build Changes build system or configuration label Aug 2, 2024
@maxnatamo maxnatamo merged commit fc6c0e5 into Fetcharr:develop Aug 2, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Changes build system or configuration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant