You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Will need https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/2257 and a reconsume by VSCode
171
+
Log.error(
172
+
"Could not read configuration while evaluating whether to run a test. This is a known issue when running tests in the VS Code IDE. To work around the problem, run individual test methods.");
173
+
} elseif (isEclipse) {
174
+
// Tracked by https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/2257; fixed in Eclipse 4.37
167
175
Log.error(
168
176
"Could not read configuration while evaluating whether to run a test. This is a known issue when running tests in the Eclipse IDE. To work around the problem, edit the run configuration and add `-uniqueId [engine:junit-jupiter]/[class:"
169
177
+ context.getRequiredTestClass().getName()
@@ -177,8 +185,14 @@ public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext con
Log.debug("The class of the class we use for mapping is " + TestConfig.class.getClassLoader());
180
-
thrownewIllegalStateException("Non-viable test classloader, " + Thread.currentThread().getContextClassLoader()
181
-
+ ". Is this a re-run of a failing test?");
188
+
Stringmessage = isVSCode
189
+
? "Could not execute test class because it was loaded with the wrong classloader by the VS Code test runner. Try running test methods individually instead."
190
+
: isEclipse
191
+
? "Could not execute test class because it was loaded with the wrong classloader by the Eclipse test runner. Try running test methods individually, or edit the run configuration and add `-uniqueId [engine:junit-jupiter]/[class:"
192
+
+ context.getRequiredTestClass().getName()
193
+
+ "]` in the program arguments. "
194
+
: "Internal error: Test class was loaded with an unexpected classloader or the thread context classloader was incorrect.";
// If anything comes through this method for which there are non-null classloaders on the selectors, that will bypass our classloading
71
+
// To check that case, the code would be something like this. We could detect and warn early, and possibly even filter that test out, but that's not necessarily a better UX than failing later
72
+
// request.getSelectorsByType(ClassSelector.class).stream().map(ClassSelector::getClassLoader) ... and then check for non-emptiness on that field
73
+
70
74
// Do not do any classloading dance for prod mode tests;
0 commit comments