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
The extractors are stubbed on both front-ends. download_file is stubbed on moon_cli only — that last line sits outside the loop. moon_engine imports download_file directly from moon_download, so the engine tests hold the real function.
Why nothing has failed
run_engine in tests/test_no_chrome.py starts the engine with "mode": "links", which extracts and never downloads. Measured with a temporary probe:
Four successes, zero downloads, nothing on disk. The real download_file is present but never called, so the gap is invisible.
Why it matters anyway
The suite's whole promise is that it needs neither a browser nor a network — no-chrome runs on a bare CI box with only aiohttp, curl_cffi and pytest installed. That promise currently holds by accident on the engine side: change run_engine to "mode": "download", or add any engine test that downloads, and the suite starts making real HTTPS requests to dl.fuckingfast.co/...?fake from CI. It would be slow, flaky, and confusing to diagnose, and the person who trips it will not be looking at conftest.py.
It also has a live consequence worth knowing: result["ok"] from run_engine counts extracted links (moon_engine.py:270), not completed downloads. Anyone reading those tests would reasonably assume otherwise — I did.
The work
Move the download_file stub inside the loop so both front-ends get it, then confirm nothing depended on the asymmetry:
pytest tests/ -q still green
The engine tests still fail when the engine drops a URL. Demonstrate it — dropping the self._inc("_ok") at moon_engine.py:270 should turn test_engine_fuckingfast_only_launches_no_browser and test_engine_mixed_batch_launches_one_shared_browser red. That is how fix: remove the never-failing ok assertion in test_no_chrome.py (#155) #157 was verified and it takes a minute.
If moving it turns something red, say so on the issue rather than working around it — a stub that cannot be applied to the engine would be telling us something about the engine, and I would want to see that before it gets patched over.
Optional, and worth more than the fix: add a short comment above the loop saying that both front-ends must be stubbed and why, so the next edit does not re-introduce the split.
Found while verifying #157. Not currently causing a failure, which is exactly why it is worth writing down.
The problem
tests/conftest.py, lines 61–65:The extractors are stubbed on both front-ends.
download_fileis stubbed onmoon_clionly — that last line sits outside the loop.moon_engineimportsdownload_filedirectly frommoon_download, so the engine tests hold the real function.Why nothing has failed
run_engineintests/test_no_chrome.pystarts the engine with"mode": "links", which extracts and never downloads. Measured with a temporary probe:Four successes, zero downloads, nothing on disk. The real
download_fileis present but never called, so the gap is invisible.Why it matters anyway
The suite's whole promise is that it needs neither a browser nor a network —
no-chromeruns on a bare CI box with onlyaiohttp,curl_cffiandpytestinstalled. That promise currently holds by accident on the engine side: changerun_engineto"mode": "download", or add any engine test that downloads, and the suite starts making real HTTPS requests todl.fuckingfast.co/...?fakefrom CI. It would be slow, flaky, and confusing to diagnose, and the person who trips it will not be looking atconftest.py.It also has a live consequence worth knowing:
result["ok"]fromrun_enginecounts extracted links (moon_engine.py:270), not completed downloads. Anyone reading those tests would reasonably assume otherwise — I did.The work
Move the
download_filestub inside the loop so both front-ends get it, then confirm nothing depended on the asymmetry:pytest tests/ -qstill greenself._inc("_ok")atmoon_engine.py:270should turntest_engine_fuckingfast_only_launches_no_browserandtest_engine_mixed_batch_launches_one_shared_browserred. That is how fix: remove the never-failing ok assertion in test_no_chrome.py (#155) #157 was verified and it takes a minute.If moving it turns something red, say so on the issue rather than working around it — a stub that cannot be applied to the engine would be telling us something about the engine, and I would want to see that before it gets patched over.
Optional, and worth more than the fix: add a short comment above the loop saying that both front-ends must be stubbed and why, so the next edit does not re-introduce the split.
Small. No Windows machine needed.