Giter Site home page Giter Site logo

codewars / codewars-runner-cli Goto Github PK

View Code? Open in Web Editor NEW
398.0 398.0 141.0 15.99 MB

Old CodeRunner project. See https://github.com/codewars/runner instead.

License: GNU Affero General Public License v3.0

JavaScript 73.28% Ruby 2.82% Haskell 1.08% Julia 1.04% Python 1.59% Clojure 3.50% Java 0.61% Makefile 0.26% Shell 0.25% Elixir 0.51% PHP 1.29% C 1.01% C++ 6.42% Crystal 0.23% Swift 0.36% Objective-C 1.00% Go 0.27% Lua 0.26% C# 3.90% Chapel 0.32%

codewars-runner-cli's People

Contributors

amitpatra avatar azhao12345 avatar britishcreamtea avatar bubbler-4 avatar cris avatar dan-nolan avatar dentzil avatar donaldkellett avatar flip111 avatar funkymonkeymonk avatar idofilus avatar insti avatar jasondebolt avatar javatlacati avatar jhoffner avatar kazk avatar lteacher avatar matt-lough avatar nathandoctor avatar neomatrixcode avatar nrakochy avatar overzealous avatar pibi avatar powerschill avatar slx64 avatar spencerwi avatar ssineriz avatar wizzup avatar xcthulhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codewars-runner-cli's Issues

Update documentation

At the moment, it's not really clear what has to be provided to add support for a new language or to upgrade to a newer version of a compiler/runtime. Apparently one needs a docker image (or change the full image?), and a test framework. But this doesn't include building/running strategies for the actual tests, which are essential.

I'm not sure whether those informations are considered internal by you or whether they're simply missing in this repository, but they're required to create support for something new.

Separate docker files

The single Docker file has gotten out of control. At this point we end up having to rebuild most if not all of the thing too often. This causes space issues as well as upload issues since all of the old stuff can't be re-used. I want to try to group common sets so that we don't have 20 images to manage. Here is what I am thinking:

Base Image:

  • ENV config
  • setup codewarrior user
  • common services (redis, mongo, sqlite, elasticsearch, etc)
  • any packages commonly used by installers (python libs, node, etc).

Node Image

  • node
  • coffeescript
  • typescript
  • npm packages

Ruby Image

  • ruby
  • gems
  • run ruby tests

Python Image

  • python 2
  • python 3
  • language packages
  • run python tests

.NET Image

  • c#
  • f#
  • dlls
  • c#/f# language tests

JVM Image

  • java
  • groovy
  • clojure
  • scala
  • language packages
  • JVM runner
  • run jvm language tests

Systems image

  • c
  • c++
  • asm/arm
  • language packages
  • ?
  • language specific tests

Lispy Image

  • Lisp
  • Racket
  • OCaml
  • Haskell
  • language packages
  • tests

Alt Languages Image (less commonly used)

  • R
  • Rust
  • Erlang
  • Elixir
  • Go
  • Julia
  • Lua
  • language packages
  • tests

We would deploy the runner to all of the non-base images just as it is today. The only difference is that the server will need to pick the image based off of the language provided. We will also need to update the build, pull and push utilities to do all of the image magic for us.

Haskell build issue on "docker_files" branch

Run node build haskell to see error. If your first run ever on the new branch then you should run node build base haskell.

Issue is related to codewarrior user installing cabal packages.

F# support

I'd love to help get F# katas running in codewars. AFAICT the .NET runner already supports F#, so I was wondering what else needs to be done to get to the point where we can start porting katas over to F#?

Ruby file permissions

require 'yaml/store'
store = YAML::Store.new 'candy.yml'

is failing due to file access error.

Javascript Runner Broken

Not sure how this happened, I hope it wasn't one of my commits...

But when I run:

docker build -t codewars/cli-runner . ; docker run -i --entrypoint mocha codewars/cli-runner test/*

I get:

...
  2 failing

  1) javascript runner .run cw-2 error handling should gracefully handle reference errors:
     Uncaught AssertionError: expected '<DESCRIBE::>test\n<IT::>test1\n<ERROR::>ReferenceError: b is not defined<:LF:>        at Test.it<:LF:>        at Test.describe<:LF:>            <:LF:>            \n<COMPLETEDIN::>2\n<IT::>test2\n<PASSED::>Test Passed\n<COMPLETEDIN::>1\n<COMPLETEDIN::>9\n' to include '\\n'
      at /codewars/test/runners/javascript_spec.js:77:50
      at /codewars/lib/shovel.js:16:9
      at ChildProcess.<anonymous> (/codewars/lib/shovel.js:106:9)
      at ChildProcess.emit (events.js:98:17)
      at Process.ChildProcess._handle.onexit (child_process.js:809:12)

  2) javascript runner .run cw-2 error handling should gracefully top level handle reference errors:
     Uncaught AssertionError: expected '<ERROR::>ReferenceError: b is not defined<:LF:>        <:LF:>            \n' to include '\\n'
      at /codewars/test/runners/javascript_spec.js:91:50
      at /codewars/lib/shovel.js:16:9
      at ChildProcess.<anonymous> (/codewars/lib/shovel.js:106:9)
      at ChildProcess.emit (events.js:98:17)
      at Process.ChildProcess._handle.onexit (child_process.js:809:12)

Rust support

First stable version was released today.
I would love to help, btw.

c# support

Check out this repo for a version of the CW test framework ported over to C#. This is an older version that writes HTML output directly, so that code needs to be updated.

Java 8?

Want to use Oracle's Java 8, rather than OpenJDK 6?

IDL

The preferred data processing language for the working astronomer. It's okay if you haven't heard of it. It's proprietary, but the good news is that there's a free dialect.

JSON Intercommunication or Dependency Support

We have some other issues open regarding restructuring the containers, and I know that this is being planned for.

The idea of having small services that intercommunicate via JSON is cool. I'd like to get started thinking about how to support this.

Notes:

  • One difficulty with this problem is: while it is straightforward to wrap a function in a dynamically typed language in something that calls it with arguments read from a JSON, this gets to be more challenging and ambiguous for typed languages and systems languages.
  • What happens if two services call one another, and get into a loop? How will this be prevented?
  • There's a lot of overhead waiting for a service. Something similar would be if we could let kata/kumite depend on other kata/kumite as libraries. In the case of GCC/LLVM languages, this would be a matter of linking object code together after compilation. In the case of python, this would be a matter of writing out modules into directory trees in a sane/predictable way. And so on for other languages.
    • If we ever decide to support Isabelle or Coq, then this would be a natural mechanism for stacking lemmas and theorems together to prove complex facts.

Hide Python's `reload` somehow

So a kata writer tried to block itertools.permutations for a little premutations kata in python.

This is really easy to sidestep:

def permutations(*args): 
  return (x for x in reload(__import__('itertools')).permutations(*args))

We need to figure out how to hide reload somehow...

Don't be Root

It's really bad that the runner runs as root. It should probably just run as a set user, who doesn't have permission to do much at all other than write some stuff to /tmp, execute some executables and read some files.

Drinks?

I'm in LA for the week, wanna go get drinks?

(I recognize this is the wrong way to ask, sorry...)

ASM

I have some contacts in industry and aerospace that have expressed that they would like to see this. In particular, people want

  • x86 ASM (with MMX?)
  • ARM ASM
  • PTX

I'm not sure the vagrant box supports MMX extensions...

Also, we need to figure out a test framework for this.

Daemons / Slow Test Runners

When I was writing the clojure runner, I found its performance was pitiful. I expect scala to be even worse. It would be pretty awful, but not surprising, if hello world in scala took more than 5 seconds.

One solution to the performance problem would be to switch over to a queue, like RabbitMQ Reddis, or SMQ, and have persistent JVMs process jobs off the queue. I recognize this is painful to implement and test, but otherwise you are looking at 1 to 2 seconds of load time you want to do anything with the JVM.

Docker Build is failing

Step 51 : RUN echo"Package: racket-docPin: origin ''Pin-Priority: -1" >> /etc/apt/preferences
 ---> Running in 6362be0ef402
/bin/sh: 1: echoPackage: racket-docPin: origin ''Pin-Priority: -1: not found
2014/08/18 02:34:07 The command [/bin/sh -c echo"Package: racket-docPin: origin ''Pin-Priority: -1" >> /etc/apt/preferences] returned a non-zero code: 127

Tests Are Broken In Docker Image

When I run:

docker build -t codewars/cli-runner . ; docker run -i --entrypoint mocha codewars/cli-runner test/*

I get:

  1) go runner .run should handle basic code evaluation:
     Uncaught Error: spawn ENOENT
      at errnoException (child_process.js:1000:11)
      at Process.ChildProcess._handle.onexit (child_process.js:791:34)

  2) java runner junit should handle basic junit tests:

      Uncaught AssertionError: expected '' to equal '42\n'
      + expected - actual

      +"42\n"
      -""

      at /codewars/test/runners/go_spec.js:15:42
      at /codewars/lib/shovel.js:14:9
      at exit (/codewars/lib/shovel.js:76:9)
      at null._onTimeout (/codewars/lib/shovel.js:135:13)
      at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

  3) java runner junit should handle junit tests failing:

      Uncaught AssertionError: expected '<DESCRIBE::>myTestFunction(TestFixture)\n<FAILED::>Failed Message expected:<5> but was:<3>\n' to equal '<DESCRIBE::>myTestFunction(TestFixture)\ntest out\n<PASSED::>Test Passed\n'
      + expected - actual

      +"<DESCRIBE::>myTestFunction(TestFixture)\ntest out\n<PASSED::>Test Passed\n"
      -"<DESCRIBE::>myTestFunction(TestFixture)\n<FAILED::>Failed Message expected:<5> but was:<3>\n"

      at /codewars/test/runners/java_spec.js:42:43
      at /codewars/lib/shovel.js:14:9
      at ChildProcess.<anonymous> (/codewars/lib/shovel.js:124:9)
      at ChildProcess.emit (events.js:98:17)
      at Process.ChildProcess._handle.onexit (child_process.js:809:12)

  4) javascript runner .run cw-2 error handling should gracefully handle custom errors:
     Error: timeout of 2000ms exceeded
      at done (/usr/local/lib/node_modules/mocha/lib/runnable.js:202:67)
      at /usr/local/lib/node_modules/mocha/lib/runnable.js:223:9
      at /codewars/test/runners/java_spec.js:68:17
      at /codewars/lib/shovel.js:14:9
      at ChildProcess.<anonymous> (/codewars/lib/shovel.js:124:9)
      at ChildProcess.emit (events.js:98:17)
      at Process.ChildProcess._handle.onexit (child_process.js:809:12)

  5) javascript runner .run cw-2 error handling should gracefully handle reference errors:
     Uncaught AssertionError: expected '<DESCRIBE::>test\n<IT::>test1\n<ERROR::>ReferenceError: b is not defined<:LF:>        at Test.it<:LF:>        at Test.describe<:LF:>            <:LF:>            \n<COMPLETEDIN::>1\n<IT::>test2\n<PASSED::>Test Passed\n<COMPLETEDIN::>0\n<COMPLETEDIN::>15\n' to include '\\n'
      at /codewars/test/runners/javascript_spec.js:85:50
      at /codewars/lib/shovel.js:14:9
      at ChildProcess.<anonymous> (/codewars/lib/shovel.js:124:9)
      at ChildProcess.emit (events.js:98:17)
      at Process.ChildProcess._handle.onexit (child_process.js:809:12)

  6) typescript runner .run should handle basic code evaluation:

      Uncaught AssertionError: expected '' to equal '42\n'
      + expected - actual

      +"42\n"
      -""

      at /codewars/test/runners/typescript_spec.js:9:42
      at /codewars/lib/shovel.js:14:9
      at ChildProcess.<anonymous> (/codewars/lib/shovel.js:124:9)
      at ChildProcess.emit (events.js:98:17)
      at Process.ChildProcess._handle.onexit (child_process.js:809:12)

Replace sync code with async code.

Much of the code has been implemented in their sync forms. The exec-sync package was recently added to the project as well. This package is not meant to be used in production code.

All code should be asynchronous to ensure that the server doesn't lock up when dealing with additional requests.

Elixir

No great reason not to support this if we are supporting Erlang

Batteries Included

For a lot of languages, there’s not much built into the core, with the exception of Python and maybe Racket.

Here's a list of core libraries/frameworks I can think of for various languages:

More later...

Fix <:LF:> for Line Feeds in Haskell, Clojure, Julia

I could do this, however:

  1. I'm not 100% sure what I'm supposed to do exactly, since I don't know how the downstream code that parses the test framework output works
  2. I'm siloed as the sole developer for these things. What's worse, I'm not an employee... so I really think someone else should touch this code (I'll review it)

Erlang Needs a Killswitch Thread

From time to time when I am working on testing erlang, my test crashes and then erlang hangs and can't start another VM.

Erlang needs a thread that always starts at boot and kills the VM after some timeout.

Write All Temporary Files to Directories in /tmp, Delete them When Done

I'm using node-temp for my haskell runner, since I noticed that the runner was leaking files. Now all the files are deleted right after they are created and run, and they all live in unique directories so they can never collide.

I am of the opinion that all of the runners should be done this way.

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.