-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why does test runner have unnecessary gems installed? (Parser) #59
Comments
Parser is used. I do not understand what you mean by "reserved class". |
How and by what? Locally:
I'm running the tests with
I mean built ins like Array, Hash, etc... |
These file use Parser and/or its subclass(s):
|
Ok, gotcha. I wonder if we should agree on a "standard" process/environment/behavior for test runners? IE, that the environment should be the same as a simple local install? JS and Wren test runners accomplish this by just being Bash scripts that simple run the same commands one would locally... Ruby is "breaking" this [pattern?] by loading a bunch of Ruby gems into the testing environment - that are not necessary and should not be there IMHO. If the code runs locally, it should run successfully in the test runner. Is this a reasonable assumption? Note: I don't think this is a super high priority, but I do think it's worth fixing. |
Worth talking about, not yet positive it is broken. The Gemfile has the intention of ensuring the same environment (to that point) is the same. Even the Ruby version can be specified there. Since this repository is named "ruby test runner" then why do we think that this is not the testing environment? It surely must be. Or are we talking about two different testing environment? The runner is from the perpective of Exercism, while the tests that the student should be using is less complex, without a gemfile, with only the requirement of Ruby and Minitest. The maintainers have a simpler requirement as well, with only Ruby, Minitest, Rubocop, Rake, and SimpleCov. |
Well, It's not the local test environment. Far from it - it seems quite different. There preferably would be a single test environment. Consistency is key. I do think it's reasonable to pin a Ruby version of course... My premise again: If the code runs locally (on same Ruby version), it should run successfully in the test runner. It's not a good experience for a student when this goes sideways... actually I saw this happen with JS once, so that's perhaps something I might track down again now that I've raised this issue. Or restated: The test runner should not [appear to] BREAK good code that passes all tests green locally. I think it's fine if we want to write the test runner itself in Ruby and use 100 gems (for convenience), but when it goes to run the actual test suite it should be doing so WITHOUT all those gems loaded or even in the LOAD_PATH... perhaps running in a subshell, etc... I do think this would be a good general policy to decide on too - or at least a "default guideline"... again, the key concern being reproducible behavior between a "default install" of a language locally and our test running environs. |
OK, so there would need to be some things defined. Such as "default I agree that if you decide to define a class that is being used on the I guess what I am saying is that there is a local test environment, the I do not think that the premise is fair for "If the code runs locally, I have ran against this where Minitest is modified and the spec version There are other situations as well where the program could run fine The message that gets reported, when this happens, is something like On the platform side, though, we can probably do better to check that So there are security aspects to consider. So had you been informed that |
Good point. I'm personally used to
I don't think I was suggesting that... just that our test runner should use the same minimal
I'm not sure what all your covering with "platform testing environment"... right now it seems to load "test runner tooling" into the test runner scope - right beside user code. Which leads to...
This is one singular great reason to run the tests in as minimal environment as possible. (since built-in [compiled] gems could hook into system API because they might have compiled C components)... the user can provide tons of their own Ruby code, but they can't provide C code that we would compile (that I'm aware of)... (of course we do this on other test runners) But no reason the Ruby test runner can't be as secure as possible... (vs other test runners with a full compile pipeline) Presumable (it's Ruby) students could write code that causes their tests to fully pass - and then those changes don't just break the runner then inject invalid/incorrect data back into the Exercism system itself... I'm not saying we have to use Bash everywhere... just that the "test running platform/tooling" should run the tests themselves in an even more minimal sandbox - not inside the same runtime as the test runner itself. |
Expected behavior:
Tests should pass, same as they do locally - Parser is not a reserved class in Core Ruby.
The text was updated successfully, but these errors were encountered: