Skip to content

Latest commit

 

History

History
83 lines (58 loc) · 3.24 KB

CONTRIBUTING.md

File metadata and controls

83 lines (58 loc) · 3.24 KB

Contributing to this project

Prerequisites

This project is actively developed using the following software. It is highly recommended that anyone contributing to this library use the same software.

  1. Visual Studio 2017.

All other dependencies are acquired via NuGet.

Building

Everything in the repo may be built via building the solution file either from Visual Studio 2017 or the command line:

msbuild /restore src\ImmutableObjectGraph.sln /t:pack

Testing

The Visual Studio 2017 Test Explorer will list and execute all tests.

Pull requests

Pull requests are welcome! They may contain additional test cases (e.g. to demonstrate a failure), and/or product changes (with bug fixes or features). All product changes should be accompanied by additional tests to cover and justify the product change unless the product change is strictly an efficiency improvement and no outwardly observable change is expected.

In the master branch, all tests should always pass. Added tests that fail should be marked as Skip via [Fact(Skip = "Test does not pass yet")] or similar message to keep our test pass rate at 100%.

Self-service releases for contributors

As soon as you send a pull request, a build is executed and updated NuGet packages are published to this Package Feed:

https://ci.appveyor.com/nuget/ImmutableObjectGraph

By adding this URL to your package sources you can immediately install your version of the NuGet packages to your project. This can be done by adding a nuget.config file with the following content to the root of your project's repo:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
        <add key="ImmutableObjectGraph CI" value="https://ci.appveyor.com/nuget/ImmutableObjectGraph" />
    </packageSources>
</configuration>

You can then install the package(s) while you have your new "ImmutableObjectGraph CI" package source selected:

Install-Package ImmutableObjectGraph.Generation -Pre -Version 0.1.41-beta-g02f355c05d

Take care to set the package version such that it exactly matches the AppVeyor build for your pull request. You can get the version number by reviewing the result of the validation build for your pull request, clicking ARTIFACTS, and noting the version of the produced packages.

There are two styles of tests:

  1. Generated and compiled at build time.
  2. Generated and compiled at test execution time.

The build-time generated tests are in source files with Build Action set to Compile and Custom Tool set to MSBuild:GenerateCodeFromAttributes. This style is best suited for when you will be testing the functionality of the generated code and must write [Fact]'s that call into that generated code.

The test execution time tests are in source files with Build Action set to Embedded Resource and Custom Tool is blank. There are associated test method(s) in another compiled test class (typically CodeGenTests.cs) that will extract the embedded resource at test execution time, execute code generation, and compile the result. This style is best suited for tests that want to assert API aspects of the generated code (such as asserting that no public constructor exists).