Bug description:
I finally got my IT department to switch to Firewalled replit, but when I copied all of my exercises over from last year’s team to the new one, the tests are broken. Input output tests don’t have any output. It is like they aren’t even running the students code. Unit tests seem the same way. On some of the repls they are just missing completely.
Expected vs Current Behavior:
I expect the tests that I have been using for years to run the students code and check it. For a simple test like printing “Hello World” to the console the test says expected “Hello World” and the actual is blank even though the student’s code is correct. Some of the students have actually been able to run a few of the tests, but when I look at the same repl I can’t even see my test. It says “Unit tests are only for Java, Python, and Javascript”. Other tests I can see and they look fine, but don’t run for the students.
Steps to reproduce:
Take working unit tests from last year and have students in firewalled replit try to run the tests.
Bug appears at this link: https://replit.com/~
Screenshot(s)/Screen Recording:
Browser/OS/Device: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
Replit Profile: https://replit.com/@EpicPhelan
This isn’t actually an issue with firewalledReplit, rather it’s an issue with the newer Python template. You can follow staff updates on this issue here:
Hey all!
We are aware of this issue and are looking into it. I will post any updates here.
1 Like
So if I have no currently working ones what do I do? Make a new one then copy the contents of that .replit and .nix?
The contents in this post should work:
In the “Files” pane, click on the three dots and select “Show hidden files”. That should show you the .replit and replit.nix config files. Below is a copy of my config files should you not have any in a known working state. Granted these files are a little bit older, but should work.
replit.nix
{ pkgs }: {
deps = [
pkgs.python310Full
pkgs.replitPackages.prybar-python310
pkgs.replitPackages.stderred
];
env = {
PYTHON_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
# Need…
# The command that runs the program. If the interpreter field is set, it will have priority and this run command will do nothing
run = "python3 main.py"
# The primary language of the repl. There can be others, though!
language = "python3"
entrypoint = "main.py"
# A list of globs that specify which files and directories should
# be hidden in the workspace.
hidden = ["venv", ".config", "**/__pycache__", "**/.mypy_cache", "**/*.pyc"]
# Specifies which nix channel to use when building the environment.
[nix]
channel = "stable-22_11"
# The command to start the interpreter.
[interpreter]
[interpreter.command]
args = [
"stderred",
"--",
"prybar-python310",
"-q",
"--ps1",
"\u0001\u001b[33m\u0002\u0001\u001b[00m\u0002 ",
"-i",
]
env = { LD_LIBRARY_PATH = "$PYTHON_LD_LIBRARY_PATH" }
[env]
VIRTUAL_ENV = "${REPL_HOME}/venv"
PATH = "${VIRTUAL_ENV}/bin"
PYTHONPATH = "$PYTHONHOME/lib/python3.10:${VIRTUAL_ENV}/lib/python3.10/site-packages"
REPLIT_POETRY_PYPI_REPOSITORY = "https://package-proxy.replit.com/pypi/"
MPLBACKEND = "TkAgg"
POETRY_CACHE_DIR = "${REPL_HOME}/.cache/pypoetry"
# Enable unit tests. This is only supported for a few languages.
[unitTest]
language = "python3"
# Add a debugger!
[debugger]
support = true
# How to start the debugger.
[debugger.interactive]
transport = "localhost:0"
startCommand = ["dap-python", "main.py"]
# How to communicate with the debugger.
[debugger.interactive.integratedAdapter]
dapTcpAddress = "localhost:0"
# How to tell the debugger to start a debugging session.
[debugger.interactive.initializeMessage]
command = "initialize"
type = "request"
[debugger.interactive.initializeMessage.arguments]
adapterID = "debugpy"
clientID = "replit"
clientName = "replit.com"
columnsStartAt1 = true
linesStartAt1 = true
locale = "en-us"
pathFormat = "path"
supportsInvalidatedEvent = true
supportsProgressReporting = true
supportsRunInTerminalRequest = true
supportsVariablePaging = true
supportsVariableType = true
# How to tell the debugger to start the debuggee application.
[debugger.interactive.launchMessage]
command = "attach"
type = "request"
[debugger.interactive.launchMessage.arguments]
logging = {}
# Configures the packager.
[packager]
language = "python3"
ignoredPackages = ["unit_tests"]
[packager.features]
enabledForHosting = false
# Enable searching packages from the sidebar.
packageSearch = true
# Enable guessing what packages are needed from the code.
guessImports = true
# These are the files that need to be preserved when this
# language template is used as the base language template
# for Python repos imported from GitHub
[gitHubImport]
requiredFiles = [".replit", "replit.nix", ".config", "venv"]
[languages]
[languages.python3]
pattern = "**/*.py"
[languages.python3.languageServer]
start = "pylsp"
[deployment]
run = ["sh", "-c", "python3 main.py"]
That worked! Thank you so much. Now I just have to copy and paste that 100 times.