Code Monkey home page Code Monkey logo

scheme-test-runner's Introduction

Scheme Test Runner

Test scheme exercisms in docker.

Plan

Pass the three parameters given to run.sh to exercise.ss. We don’t know if the student is using guile or chez, so try both. Read the output s-expressions from each and select the one with the fewest failures. Once that’s in hand, convert the keys in the association list to the format laid out in the exercism/automated-tests repository and finally output as JSON to a file results.json.

Notes

The script gets three parameters:

  • slug (eg. two-fer)
  • path to solution directory (including final slash)
  • path to output directory

The output is to be in json in the file results.json.

Output structure

Fields are “status”, “message”?, and “tests”. Each test has “name”, “status”, “message”?, “output” as fields.

Possible values for status include “pass”, “fail”, “error”. “error” is for unexpected exceptions.

todo

Most of the requirements should be implemented. One that isn’t is ensuring the output is < 500 chars.

scheme-test-runner's People

Contributors

austinmlv avatar dependabot[bot] avatar erikschierboom avatar exercism-bot avatar faisalafroz avatar guygastineau avatar ihid avatar jitwit avatar kytrinyx avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

scheme-test-runner's Issues

Upgrade to version 2 spec

We've recently updated the test runner interface specification to allow for two types of test runners, identified via a new version property in the results.json file (see the spec for the version property):

  1. version: 1 test runners are quite basic, and only detect if either all tests passed or not. These test runners capture the console output of the test runner and output that. They do not include details on individual tests passing/failing
  2. version: 2 test runners contain detailed information on individual tests passing/failing. We've recently added a required field named test_code, which contains the code the test ran to verify the behavior (see the spec for the test_code property).

The test runner's output is currently what I refer to as version 1.5: it contains the individual test information, but does not yet contain the test_code key. If possible, the test runner should be updated to also include the test code, in which case the version property should also be added with 2 as its value.

You are completely free on how you want to extract the test code, either via the AST or via finding the test code in the source code text via string manipulation.

Let me know if there are any questions.

Tests fail on exercism but pass on local system

Hello,

(I had opened an issue two months ago about the scheme runner being down).

Basically title.

Here's my code for rna-transcription

(import (rnrs))


(define (dna->rna dna)
   (string-map
    (lambda (c)
      (cond
       ((char=? c #\C) #\G)
       ((char=? c #\G) #\C)
       ((char=? c #\T) #\A)
       ((char=? c #\A) #\U))) dna))

Here's a screenshot of tests:
image

Here's a screenshot of make guile:
image

Please let me know if I can help further.

Tests for exercise “accumulator” broken?

I came upon a not-quite-fresh thread on the exercism forum, where a test suite successfully runs locally, but fails when run on the server.

After a bit of digging, I am fairly confident that the problem is this:

  • The test suite uses 1+
  • chez scheme is calling and evaluating the test suite
  • guile writes (unqote 1+) as (unquote #{1+}#)
  • chez tries to read this and throws an exception for the unknown #) syntax

New breakage!

@ErikSchierboom

Somehow the tests are failing now in the automated test runner. Here I have a screenshot of my solution to rna-transcription failing in the automated runner. I dumped it into a new test directorty here though, and I don't get the syntax error result.json. I get a passing results.json. The opacity of the website's process of running these exercises makes it very hard for me to figure out why this is happening when all of our tests are passing.

2022-06-16_09:49:00_selected


Here is a dump of the results.json I get when I run the test-runner tests locally including my rna-transcription exercise.

{"version": 2, "status": "pass", "tests": [{"name": "Empty RNA sequence", "status": "pass", "output": null, "test_code": "(equal? (dna->rna \"\") \"\")\n"}, {"name": "RNA complement of cytosine is guanine", "status": "pass", "output": null, "test_code": "(equal? (dna->rna \"C\") \"G\")\n"}, {"name": "RNA complement of guanine is cytosine", "status": "pass", "output": null, "test_code": "(equal? (dna->rna \"G\") \"C\")\n"}, {"name": "RNA complement of thymine is adenine", "status": "pass", "output": null, "test_code": "(equal? (dna->rna \"T\") \"A\")\n"}, {"name": "RNA complement of adenine is uracil", "status": "pass", "output": null, "test_code": "(equal? (dna->rna \"A\") \"U\")\n"}, {"name": "RNA complement", "status": "pass", "output": null, "test_code": "(equal? (dna->rna \"ACGTGGTCTTAA\") \"UGCACCAGAAUU\")\n"}]}

Test runner crash: exception in car: () is not a pair

If the test being run fails under either Chez or Guile then the output from stdout may be empty. If so, report-results may be passed an empty list via convert which then gets passed to failure-count and in turn car, thus causing the test runner to crash by calling car on '(). Exception in car: () is not a pair is printed on stderr.

I have submitted PR #22 to fix this.

The test system is currently broken

The test system for scheme on exercism.io is currently broken. Broken as in it gives the "something went wrong" error and basically doesn't run any actual tests.

Let me know if I can gather any more information that can help fix this

Failed tests don't output `message`

Tests that have failed don't output a message property which is essential for students using the online editor to understand what exactly has failed.

Upgrade to version 2 spec

We've recently updated the test runner interface specification to allow for two types of test runners, identified via a new version property in the results.json file (see the spec for the version property):

  1. version: 1 test runners are quite basic, and only detect if either all tests passed or not. These test runners capture the console output of the test runner and output that. They do not include details on individual tests passing/failing
  2. version: 2 test runners contain detailed information on individual tests passing/failing. We've recently added a required field named test_code, which contains the code the test ran to verify the behavior (see the spec for the test_code property).

The test runner's output is currently what I refer to as version 1.5: it contains the individual test information, but does not yet contain the test_code key. If possible, the test runner should be updated to also include the test code, in which case the version property should also be added with 2 as its value.

You are completely free on how you want to extract the test code, either via the AST or via finding the test code in the source code text via string manipulation.

Let me know if there are any questions.

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.

Possible version mismatch on exercise "Anagram"

Hey, I have recently completed the anagram exercise. It works perfectly on my machine:

$ make chez
scheme --script test.scm

Well done!

But in the exercise's online test, It shows me an ambiguous message:

An error occurred while running your tests. This might mean that there was an issue in our infrastructure, or it might mean that you have something in your code that's causing our systems to break.

Please check your code, and if nothing seems to be wrong, try running the tests again.

I really don't know how to proceed. The solution seems perfect to me. It's located on one of my public repos:

my solution file

Some info on my environment

  • scheme --version = 9.5
  • make --version = GNU Make 4.2.1 Built for x86_64-pc-linux-gnu
  • uname -a = Linux note 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • lsb_release -d = Ubuntu 20.04.4 LTS

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.