Building and Testing REEF .NET

Prerequisites

  • Windows OS.
  • Building REEF Java.
  • Visual Studio 2015 (preferred) or 2013. Most REEF developers use the free Community Edition.
  • NuGet 2.8.6 or later.
  • xunit.runner.console.2.1.0 package (installing it might require manual restore of NuGet packages).

Instructions

To build and run tests in Visual Studio on local machine:

  1. Open solution .\lang\cs\Org.Apache.REEF.sln
  2. Build solution
  3. Open Test Explorer and add search filter -Trait:Environment to filter out tests which are supposed to run on Yarn. If not filtered out, these tests will fail.
  4. Use “Run All” to run all tests

To build REEF.NET from command line, execute

msbuild .\lang\cs\Org.Apache.REEF.sln

To run .NET tests on local machine from command line, execute

msbuild .\lang\cs\TestRunner.proj

TestRunner.proj already has a filter set up to exclude Yarn tests.

Continuous Integration

We use AppVeyor to run continuous integration for REEF .NET code (i.e. build code and run tests for all pull requests and commits to master branch).

It can be convenient to set up AppVeyor for your fork of REEF repository, for example, to reproduce a test failure which can't be reproduced locally or to get AppVeyor test run results earlier than the official ones.

  1. Log in to AppVeyor using your GitHub credentials.
  2. Go to project creation and select reef repository.
  3. Fine-tune configuration as required at Settings tab of repository; you can enable building pushes to your repository when you‘re investigating something and disable them when you don’t need them.
  4. Edit AppVeyor configuration file as required (by default you'll use the same configuration as REEF build).

To isolate a specific test or group of tests, you can modify test_script section of appveyor.yml. For example, to run only one test Org.Apache.REEF.Tests.Functional.IMRU.IMRUCloseTaskTest.TestTaskCloseOnLocalRuntime modify test_script section as follows:

test_script:
  - cmd: cd .\lang\cs
  - cmd: .\.nuget\nuget.exe restore .\.nuget\packages.config -o .\packages
  - cmd: .\packages\xunit.runner.console.2.1.0\tools\xunit.console.exe .\bin\x64\Debug\Org.Apache.REEF.Tests\Org.Apache.REEF.Tests.dll -method Org.Apache.REEF.Tests.Functional.IMRU.IMRUCloseTaskTest.TestTaskCloseOnLocalRuntime

nuget restore is necessary to install xunit.runner.console package, which by default is installed in TestRunner.proj.

Instructions on Building and Testing REEF .NET from Scratch

Here is a step-by-step guide, if the instructions above didn't work and/or you prefer to build REEF .NET from Windows Command Prompt/PowerShell.

  1. Install Java Development Kit 7 or 8. Set JAVA_HOME as an Environment Variable

    • Go here to download and install appropriate JDK
    • Go to System Properties -> Environment Variables -> System Variables -> New...
    • Create a variable called JAVA_HOME and set the value to be your jdk installation dir, like C:\Program Files\Java\jdk1.8.0_91
    • Update the Environment Variable Path by adding %JAVA_HOME%\bin
  2. Install Maven 3.3.9. Set M2_HOME and M2 as Environment Variables

    • Go here to download apache-maven-3.3.9-bin.zip
    • Unzip it and place it to your desired location
    • Create an Environment Variable called M2_HOME and set the value to be your unzip location, like C:\Program Files\Apache\apache-maven-3.3.9
    • Create another variable called M2 and set the value to be %M2_HOME%\bin
    • Update the Environment Variable Path by adding %M2% and %M2_HOME%
  3. Install Protocol Buffer 2.5. Add its path as an Environment Variable

    • Go here to download protoc-2.5.0-win32.zip
    • Unzip it and place it to your desired location. Make sure that protoc.exe is in that folder
    • Update the Environment Variable Path by adding the unzip location, like C:\protobuf-2.5.0\src\protoc-2.5.0-win32
  4. Git clone the repo to your local machine: git clone git@github.com:apache/reef.git

  5. To build REEF.NET from command line, execute: msbuild .\lang\cs\Org.Apache.REEF.sln