Git Product home page Git Product logo

csharp-test-runner's Introduction

Exercism C# test runner

A test runner automatically verifies if a submission passes all the tests.

This repository contains the C# test runner, which implements the test runner interface.

Running the tests

To run a solution's tests, follow these steps:

  1. Open a command prompt in the root directory.
  2. Run ./run.ps1 <exercise> <input-directory> <output-directory>. This script will:
    1. Make sure all tests run (no skipped tests) for the solution found in <input-directory>.
    2. Run all the tests.
    3. Once the script has completed, the test results will be written to <output-directory>/results.json.

Running the tests using Docker

To run a solution's tests using a Docker container, follow these steps:

  1. Open a command prompt in the root directory.
  2. Run ./run-in-docker.ps1 <exercise> <input-directory> <output-directory>. This script will:
    1. Make sure all tests run (no skipped tests) for the solution found in <input-directory>.
    2. Run all the tests.
    3. Once the script has completed, the test results will be written to <output-directory>/results.json.

Scripts

The scripts in this repository are written in PowerShell. As PowerShell is cross-platform nowadays, you can also install it on Linux and macOS.

csharp-test-runner's People

Contributors

dependabot[bot] avatar dgee2 avatar erikschierboom avatar exercism-bot avatar faisalafroz avatar ihid avatar jrr avatar kgorbenko-sanctioned avatar kytrinyx avatar peterschussheim avatar saschamann avatar umaranis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

csharp-test-runner's Issues

Consider enhancing compiler errors.

It would be nice to prefix/suffix an error like this with something like Take a look at line 10 in bold or something. I figure this is probably doable with regexp/ansi.

Screenshot 2021-04-05 at 18 18 45

The master branch will be renamed to main

In line with our new org-wide policy, the master branch of this repo will be renamed to main. All open PRs will be automatically repointed.

GitHub will show you a notification about this when you look at this repo after renaming:

Screenshot 2021-01-27 at 15 31 45

In case it doesn't, this is the command it suggests:

git branch -m master main
git fetch origin
git branch -u origin/main main

You may like to update the primary branch on your forks too, which you can do under Settings->Branches and clicking the pencil icon on the right-hand-side under Default Branch:

Screenshot 2021-01-27 at 18 50 08

We will post a comment below when this is done. We expect it to happen within the next 12 hours.

Test runner fails if the test file is big in size

In run.ps1, Enable-All-Tests function is producing a truncated test file if the file size is big. It seems that there is a limit on the number of characters pipe operator can handle.

function Enable-All-Tests {
    Get-Content $testFile | Unskip-All-Tests | Set-Content $testFile
}

Changing the code slightly avoid the second pipe operator, resolves the issue.

function Enable-All-Tests {
    $content = Get-Content $testFile | Unskip-All-Tests
    $content | Set-Content $testFile
}

Add line number for compile errors

If there is a compile error, it is output as a string. E.g. "; expected". It would be very useful if this message would include the line number.

Test runner fails in container/website for Beauty Salon Goes Global

A mentee left the following message with their submission on the exercise.

The container that the tests run in doesn't appear to be returning any timezones from TimeZoneInfo.GetSystemTimeZones(). The tests run locally both on Linux and Windows so I'm a bit confused here. Is there some other config item that needs to be set in order for the time zones to be found or is this an environment issue with the tests being run in a container?

I have asked the member to add any additional info they might have on the issue.

Adding support to partial classes and multiple-file solutions

Sometimes, a good way to organize your C# code is to use partial classes and have different files with the implementation for the support of different interfaces.

I tried to enhance my solution to the Clock problem this way and now it seems that the test suite cannot run tests on the solution anymore. I have submitted all files, and they all appear on the web editor as different files, but it seems that they are not being compiled together and the tests fail to even start.

Here is the link to my public solution, look at the interaction 7: https://exercism.org/tracks/csharp/exercises/clock/solutions/arlm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.