New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc-test: In Markdown tests, Use all of `<h1>` to `<h6>` as the test name #44867

Merged
merged 1 commit into from Oct 15, 2017

Conversation

Projects
None yet
10 participants
@kennytm
Member

kennytm commented Sep 26, 2017

This mainly simplifies debugging error index tests, as the error codes are <h2>s in the huge document containing all codes.

@rust-highfive

This comment has been minimized.

Show comment
Hide comment
@rust-highfive

rust-highfive Sep 26, 2017

Collaborator

r? @frewsxcv

(rust_highfive has picked a reviewer for you, use r? to override)

Collaborator

rust-highfive commented Sep 26, 2017

r? @frewsxcv

(rust_highfive has picked a reviewer for you, use r? to override)

@kennytm

This comment has been minimized.

Show comment
Hide comment
@kennytm

kennytm Sep 26, 2017

Member

The rationale is to avoid useless CI output like #44480 (comment).

The errors now look like:

...

---- $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0626 (line 11733) stdout ----
	error[E0514]: found crate `std` compiled by an incompatible version of rustc
  |
  = help: please recompile that crate using this compiler (rustc 1.22.0-dev)
  = note: crate `std` path #1: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd_unicode-0dc809f4018b643d.rlib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"
  = note: crate `std` path #2: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd-202599072911ceaa.rlib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"
  = note: crate `std` path #3: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd-202599072911ceaa.dylib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"

error: aborting due to previous error

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:525:8
thread 'rustc' panicked at 'couldn't compile the test', src/librustdoc/test.rs:281:12


failures:
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0001::_::Note__this_error_code_is_no_longer_emitted_by_the_compiler_ (line 15)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0002::_::Note__this_error_code_is_no_longer_emitted_by_the_compiler_ (line 42)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0003::_::Note__this_error_code_is_no_longer_emitted_by_the_compiler_ (line 86)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0004 (line 103)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0004 (line 123)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0005 (line 150)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0005 (line 160)

...

I've conflated the current_header field into the names field since they now serve the same purpose. Also I've removed the cnt field since it is not read anywhere.

Member

kennytm commented Sep 26, 2017

The rationale is to avoid useless CI output like #44480 (comment).

The errors now look like:

...

---- $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0626 (line 11733) stdout ----
	error[E0514]: found crate `std` compiled by an incompatible version of rustc
  |
  = help: please recompile that crate using this compiler (rustc 1.22.0-dev)
  = note: crate `std` path #1: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd_unicode-0dc809f4018b643d.rlib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"
  = note: crate `std` path #2: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd-202599072911ceaa.rlib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"
  = note: crate `std` path #3: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd-202599072911ceaa.dylib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"

error: aborting due to previous error

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:525:8
thread 'rustc' panicked at 'couldn't compile the test', src/librustdoc/test.rs:281:12


failures:
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0001::_::Note__this_error_code_is_no_longer_emitted_by_the_compiler_ (line 15)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0002::_::Note__this_error_code_is_no_longer_emitted_by_the_compiler_ (line 42)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0003::_::Note__this_error_code_is_no_longer_emitted_by_the_compiler_ (line 86)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0004 (line 103)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0004 (line 123)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0005 (line 150)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index::E0005 (line 160)

...

I've conflated the current_header field into the names field since they now serve the same purpose. Also I've removed the cnt field since it is not read anywhere.

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Sep 27, 2017

Member

It's a bit ugly from my point of view. :-/

Member

GuillaumeGomez commented Sep 27, 2017

It's a bit ugly from my point of view. :-/

@kennytm

This comment has been minimized.

Show comment
Hide comment
@kennytm

kennytm Sep 27, 2017

Member

What if we truncate to <h2>?

Member

kennytm commented Sep 27, 2017

What if we truncate to <h2>?

@carols10cents

This comment has been minimized.

Show comment
Hide comment
@carols10cents
Member

carols10cents commented Oct 2, 2017

review reminder ping @GuillaumeGomez @QuietMisdreavus !

@QuietMisdreavus

This comment has been minimized.

Show comment
Hide comment
@QuietMisdreavus

QuietMisdreavus Oct 2, 2017

Member

Okay yeah, i'm a little out of my depth as to what's exactly going on here, i'm going to let imperio take over.

r? @GuillaumeGomez

Member

QuietMisdreavus commented Oct 2, 2017

Okay yeah, i'm a little out of my depth as to what's exactly going on here, i'm going to let imperio take over.

r? @GuillaumeGomez

@QuietMisdreavus QuietMisdreavus removed their assignment Oct 2, 2017

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Oct 3, 2017

Member

I appreciate the fact that you removed the cnt but I have difficulties to understand the rest. Can you provide a bit more explanations (and a comparison of the current output vs the new one) please?

Member

GuillaumeGomez commented Oct 3, 2017

I appreciate the fact that you removed the cnt but I have difficulties to understand the rest. Can you provide a bit more explanations (and a comparison of the current output vs the new one) please?

doc-test: In Markdown tests, Use all of `<h1>` to `<h6>` as the test …
…name.

This mainly simplifies debugging error index tests, as the error codes are
`<h2>`s in the huge document containing all codes.
@kennytm

This comment has been minimized.

Show comment
Hide comment
@kennytm

kennytm Oct 7, 2017

Member

@GuillaumeGomez Added comments to explain the changed role of self.names and the action in register_header().

The "after" is shown in #44867 (comment). The "before" is like:

...

---- $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 11733) stdout ----
	error[E0514]: found crate `std` compiled by an incompatible version of rustc
  |
  = help: please recompile that crate using this compiler (rustc 1.22.0-dev)
  = note: crate `std` path #1: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd_unicode-0dc809f4018b643d.rlib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"
  = note: crate `std` path #2: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd-202599072911ceaa.rlib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"
  = note: crate `std` path #3: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd-202599072911ceaa.dylib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"

error: aborting due to previous error

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:525:8
thread 'rustc' panicked at 'couldn't compile the test', src/librustdoc/test.rs:281:12


failures:
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 15)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 42)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 86)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 103)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 123)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 150)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 160)

...
Member

kennytm commented Oct 7, 2017

@GuillaumeGomez Added comments to explain the changed role of self.names and the action in register_header().

The "after" is shown in #44867 (comment). The "before" is like:

...

---- $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 11733) stdout ----
	error[E0514]: found crate `std` compiled by an incompatible version of rustc
  |
  = help: please recompile that crate using this compiler (rustc 1.22.0-dev)
  = note: crate `std` path #1: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd_unicode-0dc809f4018b643d.rlib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"
  = note: crate `std` path #2: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd-202599072911ceaa.rlib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"
  = note: crate `std` path #3: $DIR/stage0-sysroot/lib/rustlib/x86_64-apple-darwin/lib/libstd-202599072911ceaa.dylib compiled by "rustc 1.21.0-beta.1 (198109911 2017-08-29)"

error: aborting due to previous error

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:525:8
thread 'rustc' panicked at 'couldn't compile the test', src/librustdoc/test.rs:281:12


failures:
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 15)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 42)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 86)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 103)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 123)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 150)
    $DIR/test/error-index.md - Rust_Compiler_Error_Index (line 160)

...
@aidanhs

This comment has been minimized.

Show comment
Hide comment
@aidanhs

aidanhs Oct 12, 2017

Member

Hi @GuillaumeGomez, have you had a chance to take another look at this?

Member

aidanhs commented Oct 12, 2017

Hi @GuillaumeGomez, have you had a chance to take another look at this?

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Oct 13, 2017

Member

Forgot, sorry. And I still don't like it much. But if other people are interested, then it should get merged. Well anyway, please pick another reviewer, the technical side looks fine to me but I don't like the new output much. :-/

Member

GuillaumeGomez commented Oct 13, 2017

Forgot, sorry. And I still don't like it much. But if other people are interested, then it should get merged. Well anyway, please pick another reviewer, the technical side looks fine to me but I don't like the new output much. :-/

@kennytm

This comment has been minimized.

Show comment
Hide comment
@kennytm

kennytm Oct 13, 2017

Member

so... r? @alexcrichton ?

@GuillaumeGomez or do you have suggestions that makes the output looks nice while ensuring the markdown tests still show the <h2> in the test name?

Member

kennytm commented Oct 13, 2017

so... r? @alexcrichton ?

@GuillaumeGomez or do you have suggestions that makes the output looks nice while ensuring the markdown tests still show the <h2> in the test name?

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Oct 14, 2017

Member

No I don't, that's why I'd like someone else review this in case they have a better idea.

Member

GuillaumeGomez commented Oct 14, 2017

No I don't, that's why I'd like someone else review this in case they have a better idea.

@alexcrichton

This comment has been minimized.

Show comment
Hide comment
@alexcrichton

alexcrichton Oct 14, 2017

Member

@bors: r+

Looks great, thanks @kennytm!

Member

alexcrichton commented Oct 14, 2017

@bors: r+

Looks great, thanks @kennytm!

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Oct 14, 2017

Contributor

📌 Commit 0cdf587 has been approved by alexcrichton

Contributor

bors commented Oct 14, 2017

📌 Commit 0cdf587 has been approved by alexcrichton

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Oct 14, 2017

Contributor

⌛️ Testing commit 0cdf587 with merge a457e29...

Contributor

bors commented Oct 14, 2017

⌛️ Testing commit 0cdf587 with merge a457e29...

bors added a commit that referenced this pull request Oct 14, 2017

Auto merge of #44867 - kennytm:rustdoc-md-test-title, r=alexcrichton
doc-test: In Markdown tests, Use all of `<h1>` to `<h6>` as the test name

This mainly simplifies debugging error index tests, as the error codes are `<h2>`s in the huge document containing all codes.
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Oct 15, 2017

Contributor

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing a457e29 to master...

Contributor

bors commented Oct 15, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing a457e29 to master...

@bors bors merged commit 0cdf587 into rust-lang:master Oct 15, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@kennytm kennytm deleted the kennytm:rustdoc-md-test-title branch Oct 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment