GithubHelp home page GithubHelp logo

bajger / pharo-smalltalk-test-runner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from exercism/pharo-smalltalk-test-runner

0.0 0.0 0.0 60 KB

License: GNU Affero General Public License v3.0

Dockerfile 5.48% Shell 35.70% Smalltalk 58.82%

pharo-smalltalk-test-runner's Introduction

Exercism's Pharo Smalltalk Test Runner

Build & Unit tests

This is Exercism's test runner for the Pharo Smalltalk track.

Note: Pharo track Test Runner used on Exercism website should be in sync with Pharo track - commit: 65feb8a

Prepare Pharo image for Test Runner

If you'd use test runner from scripts using Docker, there is no need to prepare Pharo image, since bin/run-in-docker.sh and bin/run-tests-in-docker.sh will prepare Pharo image for you (specified in Dockerfile).
BUT: If you want to test locally without using Docker, you should use following:

  • 1st command downloads Pharo 11 (latest) including VM.
  • 2nd command installs test runner into image.
  • 3rd command runs test runner with given input parameters.
curl https://get.pharo.org | bash 
./pharo Pharo.image metacello install github://exercism/pharo-smalltalk:main/releases/latest BaselineOfExercism --groups=testRunner
./pharo Pharo.image clap testExercise slug-name pathToDirWithSolution pharoOutputDirectory

Note: Instead of testRunner group (2nd command above) you could load 'testRunnerTests to load Test Runner project baseline with tests, in case you want to run example tests.

Executing the Test Runner

The test runner requires 3 parameters:

  • slug-name Exercise slug-name (name of exercise in kebap case format)
  • input directory Path to existing directory containing the solution to be tested (one or more .st files)
  • output directory Existing directory path for the test result output (results.json)

Running the Test Runner locally

./bin/run.sh two-fer ~/exercises/two-fer /tmp/result

Note: As prerequisite, you must have Pharo VM with Pharo.image (with Test Runner installed) in working directory, otherwise runner script won't able to run Pharo locally (see how to prepare image).

Running the Test Runner from Pharo CLI

Pharo has its own command line interface to handle arguments, so you can run Test Runner directly from Pharo image using command line (same prerequisite as above):

./pharo --headless Pharo.image clap testExercise slug-name pathToDirWithSolution pharoOutputDirectory

Running Test Runner in Docker

A docker container is used to run the Test Runner against submitted exercises. As prerequisite, you'd need have Docker installed on your host OS (local) environment. To build the container locally, execute the following from the repository root directory:

docker build --rm --no-cache --load -t exercism/pharo-smalltalk-test-runner .

If you want to run example exercises (in tests directory) you should used different build argument, in order to prepare Pharo image with sample examples/exercises:

docker build --build-arg GROUP_NAMES=testRunnerTests --rm --no-cache --load -t exercism/pharo-smalltalk-test-runner .

Run the test runner in the container by passing in the slug name, and absolute paths to the exercise (solution) and a writeable output directory. These directories should be mounted as volumes (see also bin/run-in-docker.sh):

docker run \
    --read-only \
    --network none \
    --mount type=bind,src=$PWD/$2,dst=/solution \
    --mount type=bind,src=$PWD/$3,dst=/output \
    exercism/pharo-smalltalk-test-runner $1 /solution/ /output/

pharo-smalltalk-test-runner's People

Contributors

bajger avatar erikschierboom avatar exercism-bot avatar

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.