Skip to content

Commit

Permalink
Mark the Release Notes Builder integration test as "inconclusive" whe…
Browse files Browse the repository at this point in the history
…n the GitHub token is not provided. This ensures consistent behavior with other integration tests.
  • Loading branch information
Jericho committed Mar 10, 2024
1 parent 48b10b4 commit e6e10b0
Showing 1 changed file with 21 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public void Configure()
Log.Logger = _logger;

_token = Environment.GetEnvironmentVariable("GITTOOLS_GITHUB_TOKEN");
if (string.IsNullOrWhiteSpace(_token))
{
Assert.Inconclusive("Unable to locate credentials for accessing GitHub API");
}

_gitHubClient = new GitHubClient(new ProductHeaderValue("GitReleaseManager")) { Credentials = new Credentials(_token) };
}

Expand All @@ -47,44 +52,30 @@ public void TearDown()
[Explicit]
public async Task SingleMilestone()
{
if (string.IsNullOrWhiteSpace(_token))
{
Assert.Inconclusive("Unable to locate credentials for accessing GitHub API");
}
else
{
var fileSystem = new FileSystem(new CreateSubOptions());
var currentDirectory = Environment.CurrentDirectory;
var configuration = ConfigurationProvider.Provide(currentDirectory, fileSystem);
var fileSystem = new FileSystem(new CreateSubOptions());
var currentDirectory = Environment.CurrentDirectory;
var configuration = ConfigurationProvider.Provide(currentDirectory, fileSystem);

var vcsProvider = new GitHubProvider(_gitHubClient, _mapper);
var releaseNotesBuilder = new ReleaseNotesBuilder(vcsProvider, _logger, fileSystem, configuration, new TemplateFactory(fileSystem, configuration, TemplateKind.Create));
var result = await releaseNotesBuilder.BuildReleaseNotesAsync("Chocolatey", "ChocolateyGUI", "0.12.4", ReleaseTemplates.DEFAULT_NAME).ConfigureAwait(false);
Debug.WriteLine(result);
ClipBoardHelper.SetClipboard(result);
}
var vcsProvider = new GitHubProvider(_gitHubClient, _mapper);
var releaseNotesBuilder = new ReleaseNotesBuilder(vcsProvider, _logger, fileSystem, configuration, new TemplateFactory(fileSystem, configuration, TemplateKind.Create));
var result = await releaseNotesBuilder.BuildReleaseNotesAsync("Chocolatey", "ChocolateyGUI", "0.12.4", ReleaseTemplates.DEFAULT_NAME).ConfigureAwait(false);
Debug.WriteLine(result);
ClipBoardHelper.SetClipboard(result);
}

[Test]
[Explicit]
public async Task SingleMilestone3()
{
if (string.IsNullOrWhiteSpace(_token))
{
Assert.Inconclusive("Unable to locate credentials for accessing GitHub API");
}
else
{
var fileSystem = new FileSystem(new CreateSubOptions());
var currentDirectory = Environment.CurrentDirectory;
var configuration = ConfigurationProvider.Provide(currentDirectory, fileSystem);
var fileSystem = new FileSystem(new CreateSubOptions());
var currentDirectory = Environment.CurrentDirectory;
var configuration = ConfigurationProvider.Provide(currentDirectory, fileSystem);

var vcsProvider = new GitHubProvider(_gitHubClient, _mapper);
var releaseNotesBuilder = new ReleaseNotesBuilder(vcsProvider, _logger, fileSystem, configuration, new TemplateFactory(fileSystem, configuration, TemplateKind.Create));
var result = await releaseNotesBuilder.BuildReleaseNotesAsync("Chocolatey", "ChocolateyGUI", "0.13.0", ReleaseTemplates.DEFAULT_NAME).ConfigureAwait(false);
Debug.WriteLine(result);
ClipBoardHelper.SetClipboard(result);
}
var vcsProvider = new GitHubProvider(_gitHubClient, _mapper);
var releaseNotesBuilder = new ReleaseNotesBuilder(vcsProvider, _logger, fileSystem, configuration, new TemplateFactory(fileSystem, configuration, TemplateKind.Create));
var result = await releaseNotesBuilder.BuildReleaseNotesAsync("Chocolatey", "ChocolateyGUI", "0.13.0", ReleaseTemplates.DEFAULT_NAME).ConfigureAwait(false);
Debug.WriteLine(result);
ClipBoardHelper.SetClipboard(result);
}

[Test]
Expand Down

0 comments on commit e6e10b0

Please sign in to comment.