-
Notifications
You must be signed in to change notification settings - Fork 104
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
Testing Refactor #1707
base: master
Are you sure you want to change the base?
Testing Refactor #1707
Conversation
Replaces the depended functions with their equivalents.
* Remove interpreter (mostly) * Redirect testing to use ec-evaluator * Update snapshots * Update dependents of interpreter
…nto remove-interpreter
…-refactor # Conflicts: # src/__tests__/__snapshots__/scmlib.ts.snap # src/interpreter/closure.ts # src/interpreter/interpreter.ts # src/mocks/context.ts # src/repl/repl.ts # src/runner/sourceRunner.ts
# Conflicts: # src/stdlib/__tests__/__snapshots__/pylib.ts.snap # src/stdlib/__tests__/pylib.ts
# Conflicts: # src/cse-machine/interpreter.ts
…ng into testing-refactor-2
Just bumping this so that we can try to get this stuff settled |
What's left of the PR? |
|
CC: Prof @martin-henz to answer the questions |
I went back to check my 4th point cause it did seem a bit weird to me. I think what I was trying to say is that the stepper will happily evaluate up to the point of a runtime error and |
# Conflicts: # src/cse-machine/__tests__/cse-machine-runtime-context.ts # src/stepper/__tests__/__snapshots__/stepper.ts.snap
TL; DR
svml-machine.ts
js-slang
tests more robust and simplerWhat's going on:
Because our testing utilities relied heavily on the interpreter, removing it means touching almost every single part of
js-slang
, hence the ridiculous number of lines changed. I've tried to simplify the testing utilities and refactor repetitive code where necessary without breaking anything I hope. For example, I noticed that the stepper's tests were being run as async tests whengetEvaluationSteps
is no longer asynchronous. Hopefully with these changes it will make such things easier to catch.I've also configured
tsconfig.prod.json
to excludesrc/utils/testing
. Previously this code was being shipped with the rest ofjs-slang
, but given that we only use it for unit testing I don't think it should be included whenjs-slang
is being built.Given that @martin-henz has indicated that other parts of
js-slang
are marked for removal, I decided to remove them here to avoid having to refactor the tests for those parts ofjs-slang
.Please refer to the TODO comments to see what issues need to be addressed before this PR can be merged.
Will resolve these issues:
src/interpreter/interpreter-non-det.ts
(currently not working anyway) #1695src/lazy
#1696src/vm/svml-machine.ts
#1697Some issues that need to be revisited: