Skip to content

Latest commit

 

History

History
67 lines (50 loc) · 2.57 KB

build-server.md

File metadata and controls

67 lines (50 loc) · 2.57 KB

Build Server

Getting .received files from CI

AppVeyor

Use a on_failure build step to call Push-AppveyorArtifact.

on_failure:
  - ps: Get-ChildItem *.received.* -recurse | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }

snippet source | anchor

See also Pushing artifacts from scripts.

GitHub Actions

Use a if: failure() condition to upload any *.received.* files if the build fails.

- name: Upload Test Results
  if: failure()
  uses: actions/upload-artifact@v2
  with:
    name: verify-test-results
    path: |
      **/*.received.*

Custom directory and file name

In some scenarios, as part of a build, the test assemblies are copied to a different directory or machine to be run. In this case custom code will be required to derive the path to the .verified. files. This can be done using DerivePathInfo.

For example a possible implementation for AppVeyor could be:

if (BuildServerDetector.Detected)
{
    var buildDirectory = Environment.GetEnvironmentVariable("APPVEYOR_BUILD_FOLDER")!;
    VerifierSettings.DerivePathInfo(
        (sourceFile, projectDirectory, type, method) =>
        {
            var testDirectory = Path.GetDirectoryName(sourceFile)!;
            var testDirectorySuffix = testDirectory.Replace(projectDirectory, string.Empty);
            return new(directory: Path.Combine(buildDirectory, testDirectorySuffix));
        });
}

snippet source | anchor