Skip to content

Disable ttyrec recording by default in tests to avoid polluting the directory in which tests are run#105

Open
jbcoe wants to merge 1 commit intoNetHack-LE:mainfrom
jbcoe:jbcoe/clean-tests
Open

Disable ttyrec recording by default in tests to avoid polluting the directory in which tests are run#105
jbcoe wants to merge 1 commit intoNetHack-LE:mainfrom
jbcoe:jbcoe/clean-tests

Conversation

@jbcoe
Copy link

@jbcoe jbcoe commented Mar 9, 2026

Before this change, a file (nle.ttyrec3.bz2) is written to the project root when tests are run. I'm curious as to why we've not spotted this before.

Investigation in progress so leaving this as a draft for now.

@jbcoe jbcoe changed the title Add fixture to disable ttyrec recording by default in tests Disable ttyrec recording by default in tests to avoid polluting the directory in which tests are run Mar 9, 2026
@StephenOman
Copy link
Collaborator

I've just ignored the file so far!

@jbcoe jbcoe marked this pull request as ready for review March 10, 2026 08:45
@jbcoe
Copy link
Author

jbcoe commented Mar 10, 2026

If this is know about, I'll consider my investigation complete.

I don't think that running tests should need write access to the working directory, this PR fixes that.

@StephenOman
Copy link
Collaborator

As a principle, I prefer to have the tests clean up any files that are created as part of the normal run rather than have the test modify the code like that. What do you think?

@jbcoe
Copy link
Author

jbcoe commented Mar 18, 2026

We could explicitly supply None to all uses of Nethack but that's a noisier change.

I'm not too fond of the monkey-patching as it's brittle.

Ideally Nethack instances would not write to disk by default but that feels like a larger change.

@StephenOman
Copy link
Collaborator

I'd prefer the None option - it's a valid path in the code, regardless of how noisy the change would be.

We could also some new tests to explicitly create a named ttyrec file and the default one to check that it continues to work, and have those tests clean up after themselves.

I think creating a ttyrec is a really important feature though. Imagine getting an agent to ascend and not having a recording of it! 😱

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.

2 participants