Skip to content
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

Fix theme-checker failure #61181

Merged
merged 3 commits into from
Jun 22, 2019
Merged

Conversation

GuillaumeGomez
Copy link
Member

Fixes #61145.

I didn't find a way to check it without strongly depending on the output... Is there a way to check if a program fails without checking its output?

r? @QuietMisdreavus

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 25, 2019
@czipperz
Copy link
Contributor

You should probably add a regression test here if possible

@GuillaumeGomez
Copy link
Member Author

@czipperz:

I didn't find a way to check it without strongly depending on the output... Is there a way to check if a program fails without checking its output?

@czipperz
Copy link
Contributor

Try writing a test on this function?

@czipperz
Copy link
Contributor

It doesn't even need to assert anything. TDD dictates you need a failing test case to change code. Panicking is failing the test

@czipperz
Copy link
Contributor

Or assert_eq!(load_css_events(Vec::new()), Vec::new());

@czipperz
Copy link
Contributor

Are you referring to a system level test here? That might be more difficult.

@GuillaumeGomez
Copy link
Member Author

I was speaking at a system level, indeed. :) I'll add a function test instead.

@GuillaumeGomez
Copy link
Member Author

I added a test but like I said, I don't think this is the best way. I guess it'll work for now...

@czipperz
Copy link
Contributor

It seems the check pos + 1 < v.len() is duplicated multiple times in the while loop body. What do you think about eliminating these?

@GuillaumeGomez
Copy link
Member Author

I think it's a valid request so I'll remove them.

@GuillaumeGomez
Copy link
Member Author

Removed them!

@GuillaumeGomez
Copy link
Member Author

r? @Manishearth

@Manishearth
Copy link
Member

I don't really have time to review this rn.

@GuillaumeGomez
Copy link
Member Author

Let's try someone else then!

cc @rust-lang/rustdoc

@GuillaumeGomez
Copy link
Member Author

r? @ollie27

@rust-highfive rust-highfive assigned ollie27 and unassigned Manishearth Jun 11, 2019
@GuillaumeGomez
Copy link
Member Author

r? @kinnison

Copy link
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments, but otherwise LGTM. I'm not sure if I'm able to approve properly on this codebase but you have a 👍 from me modulo the query about panicing.

src/librustdoc/theme.rs Show resolved Hide resolved
src/librustdoc/theme.rs Show resolved Hide resolved
@GuillaumeGomez
Copy link
Member Author

@kinnison Updated!

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:14d0619d:start=1561064659786871729,finish=1561064749216727195,duration=89429855466
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
    100% |████████████████████████████████| 51kB 21.1MB/s 
Collecting colorama<=0.3.9,>=0.2.5 (from awscli)
  Downloading https://files.pythonhosted.org/packages/db/c8/7dcf9dbcb22429512708fe3a547f8b6101c0d02137acbd892505aee57adf/colorama-0.3.9-py2.py3-none-any.whl
Collecting botocore==1.12.173 (from awscli)
  Downloading https://files.pythonhosted.org/packages/af/bb/226c21c8ff37c620412280e71dd7b0135c50d380ac212e3cd0c34d4bc6ef/botocore-1.12.173-py2.py3-none-any.whl (5.6MB)
    0% |▏                               | 20kB 22.9MB/s eta 0:00:01
    0% |▏                               | 30kB 26.4MB/s eta 0:00:01
    0% |▎                               | 40kB 26.2MB/s eta 0:00:01
    0% |▎                               | 51kB 27.6MB/s eta 0:00:01
---
travis_time:start:test_assembly
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:03:49] 
[01:03:49] running 9 tests
[01:03:49] iiiiiiiii
[01:03:49] 
[01:03:49]  finished in 0.157
[01:03:49] travis_fold:end:test_assembly

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:04:05] 
[01:04:05] running 122 tests
[01:04:30] .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....i..........iiii..........i...ii...i.......ii.i 100/122
[01:04:34] .i.i......iii.i.....ii
[01:04:34] 
[01:04:34]  finished in 29.721
[01:04:34] travis_fold:end:test_debuginfo

---
[01:05:42]    Compiling rustdoc v0.0.0 (/checkout/src/librustdoc)
[01:05:47] error[E0308]: mismatched types
[01:05:47]    --> src/librustdoc/theme.rs:106:28
[01:05:47]     |
[01:05:47] 106 |     v.get(pos + 1) == Some(b'/')
[01:05:47]     |                            |
[01:05:47]     |                            expected &u8, found u8
[01:05:47]     |                            help: consider borrowing here: `&b'/'`
[01:05:47]     |
---
travis_time:end:1c30a15d:start=1561068708004126374,finish=1561068708008816556,duration=4690182
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:02f0a7a4
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0a29a0da
travis_time:start:0a29a0da
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:38540820
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

Copy link
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modulo the need for a borrow in that rewritten test, which I've just realised is in a non-public function so your comment about the guard in the public function meaning it won't be necessary anyway holds, 👍

@GuillaumeGomez
Copy link
Member Author

Removed the last commit then. Thanks for your review!

@bors: r=kinnison

@bors
Copy link
Contributor

bors commented Jun 21, 2019

📌 Commit 640bdbd has been approved by kinnison

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 21, 2019
Centril added a commit to Centril/rust that referenced this pull request Jun 21, 2019
…=kinnison

Fix theme-checker failure

Fixes rust-lang#61145.

I didn't find a way to check it without strongly depending on the output... Is there a way to check if a program fails without checking its output?

r? @QuietMisdreavus
Centril added a commit to Centril/rust that referenced this pull request Jun 21, 2019
…=kinnison

Fix theme-checker failure

Fixes rust-lang#61145.

I didn't find a way to check it without strongly depending on the output... Is there a way to check if a program fails without checking its output?

r? @QuietMisdreavus
Centril added a commit to Centril/rust that referenced this pull request Jun 21, 2019
…=kinnison

Fix theme-checker failure

Fixes rust-lang#61145.

I didn't find a way to check it without strongly depending on the output... Is there a way to check if a program fails without checking its output?

r? @QuietMisdreavus
bors added a commit that referenced this pull request Jun 22, 2019
Rollup of 9 pull requests

Successful merges:

 - #60971 (Add DocFS layer to rustdoc)
 - #61146 (SliceConcatExt::connect defaults to calling join)
 - #61181 (Fix theme-checker failure)
 - #61267 (rustc-book: Update the rustc/clang compatibility table for xLTO.)
 - #61270 (Remove warnings about incr. comp. generating less debugging output.)
 - #61681 (Changed the error message to more clearly explain what is allowed)
 - #61984 (More NodeId pruning)
 - #62016 (Add test for issue-27697)
 - #62019 (Remove needless lifetimes)

Failed merges:

r? @ghost
@bors bors merged commit 640bdbd into rust-lang:master Jun 22, 2019
@bors
Copy link
Contributor

bors commented Jun 22, 2019

⌛ Testing commit 640bdbd with merge e562b24...

@GuillaumeGomez GuillaumeGomez deleted the fix-theme-checker branch June 22, 2019 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustdoc --theme-checker panics when given an empty file
8 participants