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

Update and improve test262 integration #372

Merged
merged 1 commit into from
Jan 16, 2018
Merged

Conversation

sainaen
Copy link
Contributor

@sainaen sainaen commented Dec 24, 2017

  1. Update the test262 submodule to the latest version

    This brings more test cases to already enabled folders, but also
    requires more exclusions of currently failing checks. I wanted to
    avoid accidentally excluding passing files, so exclusion lists for
    some directories/features are quiet large. At some point I'd like
    to be able to generate the test262.properties automatically, but
    with more logging manual edits are good enough for now.

  2. Improve test262 runner (Test262SuiteTest class)

    • Allow arbitrary names of expected exceptions and support the new
      structure of the 'negative' section in tests' metadata
    • Distinguish exception's phase, early vs runtime, for negative tests
    • Support for a 'raw' flag: no harness files, implies 'noStrict'
    • Add filtering by the 'features' lists
    • Exclude tests with a 'module' flag, as this isn't supported by Rhino
    • Exclude tests with an 'async' flag, which isn't yet supported by
      the Test262SuiteTest itself
    • Couple of other smaller fixes
  3. Enable more tests, mostly from the 'language' folder

    This brings the total number of passing test cases to 45k, generated from 7779 files.
    The execution time incises, but not by that much. Before it took around 1min 15s
    and now it's about 1min 50s on my laptop.

    Parameters generation (reading test262.properties, recursively walking folders,
    reading files and parsing their YAML headers) takes slightly more than 2s. For
    26k tests (4454 files) in master it takes 1.4s. I believe there are some possible
    improvements, but it's such a small component I didn't spent much time on it.

1. Update the test262 submodule to the latest version

This brings more test cases to already enabled folders, but also
requires more exclusions of currently failing checks.

2. Improve test262 runner (Test262SuiteTest class)

* Allow arbitrary names of expected exceptions and support the new
  structure of the 'negative' section in tests' metadata
* Distinguish exception's phase, early vs runtime, for negative tests
* Support for a 'raw' flag: no harness files, implies 'noStrict'
* Add filtering by the 'features' lists
* Exclude tests with a 'module' flag, as this isn't supported by Rhino
* Exclude tests with an 'async' flag, which isn't yet supported by
  the Test262SuiteTest itself
* Couple of other smaller fixes

3. Enable more tests, mostly from the 'language' folder

This brings the total number of passing tests to 44k.
@gbrail
Copy link
Collaborator

gbrail commented Jan 16, 2018

I seem to be getting an error parsing some of the metadata, below:

Do you have a chance to look at this?

java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
at org.mozilla.javascript.tests.Test262SuiteTest$Test262Case.fromSource(Test262SuiteTest.java:376)
at org.mozilla.javascript.tests.Test262SuiteTest.test262SuiteValues(Test262SuiteTest.java:290)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.runners.Parameterized.allParameters(Parameterized.java:280)
at org.junit.runners.Parameterized.(Parameterized.java:248)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:86)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:57)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:66)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy1.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:108)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:146)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:128)
at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)

@sainaen
Copy link
Contributor Author

sainaen commented Jan 16, 2018

Sure. It’s a bit late here already, I’ll check this tomorrow.

But as a guess: have you updated the test262 submodule when you got this exception? (I always forget that git checkout isn’t enough and you have to do git submodule --update.)

@gbrail
Copy link
Collaborator

gbrail commented Jan 16, 2018 via email

@gbrail gbrail merged commit a8b4f43 into mozilla:master Jan 16, 2018
@sainaen sainaen deleted the test262-upd branch January 16, 2018 21:28
@sainaen
Copy link
Contributor Author

sainaen commented Jan 16, 2018

Great! Thanks for merging!

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

Successfully merging this pull request may close these issues.

None yet

2 participants