Skip to content
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

Draft
wants to merge 69 commits into
base: master
Choose a base branch
from
Draft

Testing Refactor #1707

wants to merge 69 commits into from

Conversation

leeyi45
Copy link
Contributor

@leeyi45 leeyi45 commented May 22, 2024

TL; DR

  • Remove the interpreter (alongside non-det)
  • Remove the lazy variant
  • Remove svml-machine.ts
  • Remove remnants of the old type checker
  • Make js-slang tests more robust and simpler

What'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 when getEvaluationSteps is no longer asynchronous. Hopefully with these changes it will make such things easier to catch.

I've also configured tsconfig.prod.json to exclude src/utils/testing. Previously this code was being shipped with the rest of js-slang, but given that we only use it for unit testing I don't think it should be included when js-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 of js-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:

Some issues that need to be revisited:

RichDom2185 and others added 30 commits January 23, 2024 15:29
Replaces the depended functions with their equivalents.
* Remove interpreter (mostly)
* Redirect testing to use ec-evaluator
* Update snapshots
* Update dependents of 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
Copy link
Member

@RichDom2185 RichDom2185 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, thanks a lot for this! I agree with the questions that are to be answered, let's wait for Prof to come back from his break.

I did a really really quick run through and give my in-principle approval – let's merge this PR if possible, I don't see why the SICP issue needs to be resolved first, since they can always retain an older version of js-slang in their package.json.

src/__tests__/environment.ts Outdated Show resolved Hide resolved
@leeyi45
Copy link
Contributor Author

leeyi45 commented May 22, 2024

One more thing: I have no idea what inspect() or any of those related things do, so I haven't been able to remove things like the Scheduler

Ideally I'd like to remove things like manualToggleDebugger since it doesn't seem like we're using it anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants