Failed to import junit package for Java Unit Test

Problem description:
When running unit tests in a Java environment, it stalls on “Installing imported packages”, then fails with the error of “error: package org.junit does not exist”. It seems like the environment is not installing the junit package.

Expected behavior:
When the “:arrow_forward: Run Tests” button is pressed, the unit tests are run against the code provided.

Actual behavior:
When the “:arrow_forward: Run Tests” button is pressed, it stalls on “Installing imported packages”, then fails with the error of “error: package org.junit does not exist”.

Steps to reproduce:

  1. Open a replit with a Java environment that contains a unit test.
  2. Open Tools > Unit Tests > :arrow_forward: Run Tests
  3. Watch the console.

Bug appears at this link:
https://replit.com/@MrGajewski/Unit-Testing#Main.java

Browser/OS/Device:
Google Chrome / Windows 10 / Lenovo ThinkStation

This seems to be working in my main public-facing Replit folder, but is still not working in my Teams folder.

I have had random success by doing any/all of the following:

  • Open the Packages tab and ensure that JUnit is included. Often even after including it, I have to go here just to force the Repl to acknowledge that it is a part of the environment.
  • Delete all .class files to force it to recompile the java files (though it should be doing this anyway)

Even STILL I’m only at about a 65% fix rate on this issue, and if my students refresh their page, or if the Repl disconnects/reconnects for any reason it may go back to failing again.

This is a significant problem right now as my students rely on the automated tests during their performance tasks to see their progress.

I also seem to have noticed a correlation: If the version number doesn’t show up next to the junit:junit in the Packages tab, it doesn’t run.

This is entirely anecdotal as this is all that was different between the last time it worked and the last time that it didn’t work.

This appears to be an issue again today. I also cannot seem to find the JUnit package to add manually. Is anyone else seeing this problem this afternoon (we are in Ontario, Canada)? My classes from this morning did not have any issues, but a couple of hours later my afternoon class can’t get any of the automated testing to work.

1 Like

I have the same problem