Skip to content

Commit

Permalink
Only run unit tests, README for integration tests
Browse files Browse the repository at this point in the history
- TODO grooming
  • Loading branch information
ChrisSimmons committed Mar 29, 2024
1 parent 8c75282 commit 3011ceb
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal -f net6
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal -f net6 ./UnitTests/UnitTests.csproj
- uses: actions/upload-artifact@v4
with:
name: artifacts
Expand Down
1 change: 0 additions & 1 deletion GettyImages.Api/AiGenerator/GetDownloadSizes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace GettyImages.Api.AiGenerator;

// TODO - Naming?
public class GetDownloadSizes : ApiRequest<GeneratedDownloadSizesResponse>
{
private GetDownloadSizes(Credentials credentials, string baseUrl, DelegatingHandler customHandler) : base(
Expand Down
1 change: 0 additions & 1 deletion GettyImages.Api/AiGenerator/GetGeneratedImageDownload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

namespace GettyImages.Api.AiGenerator;

// TODO - Naming?
public class GetGeneratedImageDownload : PolledPathApiRequest<DownloadGeneratedImageReadyResponse>
{
private GetGeneratedImageDownload(Credentials credentials, string baseUrl, DelegatingHandler customHandler) : base(
Expand Down
1 change: 0 additions & 1 deletion GettyImages.Api/AiGenerator/GetGeneratedImageVariations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

namespace GettyImages.Api.AiGenerator;

// TODO - Naming
public class GetGeneratedImageVariations : ImageGenerationsApiRequest
{
private GetGeneratedImageVariations(Credentials credentials, string baseUrl, DelegatingHandler customHandler) : base(
Expand Down
1 change: 0 additions & 1 deletion GettyImages.Api/AiGenerator/GetGeneratedImages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

namespace GettyImages.Api.AiGenerator;

// TODO - Naming?
public class GetGeneratedImages : PolledPathApiRequest<ImageGenerationsReadyResponse>
{
private GetGeneratedImages(Credentials credentials, string baseUrl, DelegatingHandler customHandler) : base(
Expand Down
1 change: 0 additions & 1 deletion GettyImages.Api/AiGenerator/ImageGenerations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

namespace GettyImages.Api.AiGenerator;

// TODO - Naming? "GenerateImages"?
public class ImageGenerations : ImageGenerationsApiRequest
{
private ImageGenerations(Credentials credentials, string baseUrl, DelegatingHandler customHandler) : base(
Expand Down
10 changes: 1 addition & 9 deletions GettyImages.Api/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,6 @@ public Customers.Customers Customers()
return Api.Customers.Customers.GetInstance(_credentials, _baseUrl, _customHandler);
}

// TODO - Naming?
/// <summary>
/// Generate images
/// </summary>
Expand All @@ -631,9 +630,8 @@ public ImageGenerations ImageGenerations()
return AiGenerator.ImageGenerations.GetInstance(_credentials, _baseUrl, _customHandler);
}

// TODO - Naming?
/// <summary>
/// Get generated images
/// Get generated images after using <see cref="ImageGenerations"/>
/// </summary>
/// <returns>
/// The <see cref="AiGenerator.GetGeneratedImages" />.
Expand All @@ -643,7 +641,6 @@ public GetGeneratedImages GetGeneratedImages()
return AiGenerator.GetGeneratedImages.GetInstance(_credentials, _baseUrl, _customHandler);
}

// TODO - Naming?
/// <summary>
/// Get generated image download
/// </summary>
Expand All @@ -655,7 +652,6 @@ public GetGeneratedImageDownload GetGeneratedImageDownload()
return AiGenerator.GetGeneratedImageDownload.GetInstance(_credentials, _baseUrl, _customHandler);
}

// TODO - Naming?
/// <summary>
/// Download a generated image
/// </summary>
Expand All @@ -667,7 +663,6 @@ public DownloadGeneratedImage DownloadGeneratedImage()
return AiGenerator.DownloadGeneratedImage.GetInstance(_credentials, _baseUrl, _customHandler);
}

// TODO - Naming?
/// <summary>
/// Get download sizes for a generated image
/// </summary>
Expand All @@ -679,7 +674,6 @@ public GetDownloadSizes GetDownloadSizes()
return AiGenerator.GetDownloadSizes.GetInstance(_credentials, _baseUrl, _customHandler);
}

// TODO - Naming?
/// <summary>
/// Get variations on a generated image
/// </summary>
Expand All @@ -691,7 +685,6 @@ public GetGeneratedImageVariations GetGeneratedImageVariations()
return AiGenerator.GetGeneratedImageVariations.GetInstance(_credentials, _baseUrl, _customHandler);
}

// TODO - Naming?
/// <summary>
/// Redownload a generated image
/// </summary>
Expand All @@ -703,4 +696,3 @@ public GeneratedImageRedownload GeneratedImageRedownload()
return AiGenerator.GeneratedImageRedownload.GetInstance(_credentials, _baseUrl, _customHandler);
}
}

3 changes: 0 additions & 3 deletions IntegrationTests/AiGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

namespace IntegrationTests;

// TODO - README for secrets
/// <summary>
/// The AI Generator operations are more complex than the other operations in the API.
/// Locally-run integration tests are warranted to ensure that the operations are functioning as expected.
Expand Down Expand Up @@ -217,10 +216,8 @@ public async Task InitializeAsync()

public DownloadGeneratedImageReadyResponse DownloadGeneratedImageResponse { get; private set; }

Check warning on line 217 in IntegrationTests/AiGeneratorTests.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'DownloadGeneratedImageResponse' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

// TODO - Naming is confusing
public ImageGenerationsReadyResponse GetGeneratedImagesResponse { get; private set; }

// TODO - Naming is confusing
public ImageGenerationsReadyResponse ImageGenerationsResponse { get; private set; }

public Task DisposeAsync()
Expand Down
3 changes: 3 additions & 0 deletions IntegrationTests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Integration Tests

Some API calls need more in-depth testing to assure correctness. For these we have integration tests which are to be executed locally with secrets provided in configuration, primarily through [`dotnet user-secrets`](https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets).

0 comments on commit 3011ceb

Please sign in to comment.