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(tests): update the expected output in cli tests #1362

Merged
merged 1 commit into from
Jan 28, 2024

Conversation

orhun
Copy link
Contributor

@orhun orhun commented Jan 27, 2024

I was getting the following error while running the tests for the Arch Linux package:

--- STDOUT:              lychee::cli cli::test_failure_github_404_no_token ---

running 1 test
test cli::test_failure_github_404_no_token ... FAILED

failures:

failures:
    cli::test_failure_github_404_no_token

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 68 filtered out; finished in 0.27s


--- STDERR:              lychee::cli cli::test_failure_github_404_no_token ---
thread 'cli::test_failure_github_404_no_token' panicked at /usr/src/debug/rust/rustc-1.75.0-src/library/core/src/ops/function.rs:250:5:
Unexpected stdout, failed var.contains(There were issues with Github URLs. You could try setting a Github token and running lychee again.)
├── var: Issues found in 1 input. Find details below.
│
│   [/build/lychee/src/lychee-0.14.2/fixtures/TEST_GITHUB_404.md]:
│   ✗ [404] https://github.com/mre/idiomatic-rust-doesnt-exist-man | Failed: Network error: Not Found
│
│   🔍 1 Total (in 0s) ✅ 0 OK 🚫 1 Error
└── var as str: Issues found in 1 input. Find details below.

    [/build/lychee/src/lychee-0.14.2/fixtures/TEST_GITHUB_404.md]:
    ✗ [404] https://github.com/mre/idiomatic-rust-doesnt-exist-man | Failed: Network error: Not Found

    🔍 1 Total (in 0s) ✅ 0 OK 🚫 1 Error

command=`env -i "/build/lychee/src/lychee-0.14.2/target/debug/lychee" "/build/lychee/src/lychee-0.14.2/fixtures/TEST_GITHUB_404.md" "--no-progress"`
code=2
stdout=
Issues found in 1 input. Find details below.

[/build/lychee/src/lychee-0.14.2/fixtures/TEST_GITHUB_404.md]:
✗ [404] https://github.com/mre/idiomatic-rust-doesnt-exist-man | Failed: Network error: Not Found

🔍 1 Total (in 0s) ✅ 0 OK 🚫 1 Error


stderr=`
✗ [404] https://github.com/mre/idiomatic-rust-doesnt-exist-man | Failed: Network error: Not Found
💡 There were issues with Github URLs. You could try setting a Github token and running lychee again.`

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Canceling due to test failure
PASS [ 0.425s] lychee::cli cli::test_formatted_file_output

---

     Summary [   9.386s] 29/289 tests run: 28 passed, 1 failed, 0 skipped
        FAIL [   0.275s] lychee::cli cli::test_failure_github_404_no_token

error: test run failed
==> ERROR: A failure occurred in check().

Then I figured it must be because the second message should be in stderr instead of stdout.

I applied the patch from this PR and now the tests pass! 🥳

P.S. I don't know why this is not caught by the CI :/

@mre mre merged commit b882a14 into lycheeverse:master Jan 28, 2024
7 checks passed
@mre
Copy link
Member

mre commented Jan 28, 2024

Huh, I have no clue what's going on there, but thanks for the investigation and the fix!
It is true that I moved that to stderr lately, but I thought the test should have failed before. 🤔 Anyway...

renovate bot added a commit to woodpecker-ci/woodpecker that referenced this pull request Feb 24, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [lycheeverse/lychee](https://togithub.com/lycheeverse/lychee) | patch
| `0.14.0` -> `0.14.3` |

---

### Release Notes

<details>
<summary>lycheeverse/lychee (lycheeverse/lychee)</summary>

###
[`v0.14.3`](https://togithub.com/lycheeverse/lychee/releases/tag/v0.14.3):
Version 0.14.3

[Compare
Source](https://togithub.com/lycheeverse/lychee/compare/v0.14.0...v0.14.3)

<!-- Release notes generated using configuration in .github/release.yml
at master -->

#### What's Changed

##### Miscellaneous and Others 🔔

- fix(tests): update the expected output in cli tests by
[@&#8203;orhun](https://togithub.com/orhun) in
[lycheeverse/lychee#1362
- status.rs: Make json output more verbose by
[@&#8203;Asiderr](https://togithub.com/Asiderr) in
[lycheeverse/lychee#1367
- Set URI to HTTPS for ErrorKind::InsecureURL by
[@&#8203;Elkiwa](https://togithub.com/Elkiwa) in
[lycheeverse/lychee#1369
- Fixed fragment generation for headings with inline code by
[@&#8203;HU90m](https://togithub.com/HU90m) in
[lycheeverse/lychee#1370
- Move to workspace versioning by
[@&#8203;mre](https://togithub.com/mre) in
[lycheeverse/lychee#1372

#### New Contributors

- [@&#8203;Asiderr](https://togithub.com/Asiderr) made their first
contribution in
[lycheeverse/lychee#1367
- [@&#8203;Elkiwa](https://togithub.com/Elkiwa) made their first
contribution in
[lycheeverse/lychee#1369

**Full Changelog**:
lycheeverse/lychee@v0.14.2...v0.14.3

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "every weekend" (UTC), Automerge -
"before 4am" (UTC).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/woodpecker-ci/woodpecker).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMDAuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIwMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
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.

None yet

2 participants