Skip to content

Conversation

@ehuss
Copy link
Contributor

@ehuss ehuss commented Dec 10, 2025

This fixes a problem where custom preprocessors were not being registered when running tests. This was caused by the test function rebuilding the preprocessor map.

This removes the code that was rebuilding the preprocessors and removing the IndexPreprocessor when running tests. Skipping IndexPreprocessor was added back in #741 to fix #724 which was caused by #685 which added the IndexPreprocessor.

Additionally, #1986 added running all preprocessors.

The IndexPreprocessor was removed because in the past the code was testing against the source directly, and the path from chapter.path is the converted index.md file, and that filename does not exist in the source. This isn't a problem anymore because due to #891 it is not reading from the src directory.

Note that this results in a minor change where the chapter path changes from README.md to index.md in the output and the --chapter option. I think I'm ok with that change, though it would be easy to switch it back if that's an issue.

This test illustrates that the test function is not working correctly
when there is a custom preprocessor.
This fixes a problem where custom preprocessors were not being
registered when running tests. This was caused by the test function
rebuilding the preprocessor map.

This removes the code that was rebuilding the preprocessors and removing
the IndexPreprocessor when running tests. Skipping IndexPreprocessor was
added back in rust-lang#741 to fix
rust-lang#724 which was caused by
rust-lang#685 which added the
IndexPreprocessor.

Additionally, rust-lang#1986 added
running *all* preprocessors.

The IndexPreprocessor was removed because in the past the code was
testing against the source directly, and the path from `chapter.path` is
the converted `index.md` file, and that filename does not exist in the
source. This isn't a problem anymore because due to
rust-lang#891 it is not reading from the
`src` directory.

Note that this results in a minor change where the chapter path changes
from `README.md` to `index.md` in the output and the `--chapter` option.
I think I'm ok with that change, though it would be easy to switch it
back if that's an issue.
@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Dec 10, 2025
@ehuss ehuss added this pull request to the merge queue Dec 10, 2025
Merged via the queue into rust-lang:master with commit 938a912 Dec 10, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: waiting on a review label Dec 10, 2025
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.

"mdbook test" stopped working with 0.1.8

2 participants