Commit Graph

36 Commits

Author SHA1 Message Date
benluiwj
a1361bd0d5 Run check-diff tests in ci 2024-08-03 05:17:27 -06:00
Yacin Tmimi
8c4c336e37 remove archived error-chain crate from integration tests
Can't run `cargo test --all` for `error-chain` anymore. The tests don't
compile because of `#[deny(invalid_doc_attributes)]`. Here's  the error
message:

```
error: this attribute can only be applied at the crate level
   --> tests/tests.rs:508:7
    |
508 | #[doc(test)]
    |       ^^^^
    |
    = note: read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information
    = note: `#[deny(invalid_doc_attributes)]` on by default
help: to apply to the crate, use an inner attribute
    |
508 | #![doc(test)]
    |  +
```
2024-06-12 22:40:05 -04:00
hanghuge
728939191e chore: fix some typos
Signed-off-by: hanghuge <cmoman@outlook.com>
2024-04-07 15:20:42 -05:00
Josh Soref
cedb7b5058
Spelling (#5753)
various spelling fixes
---------

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2024-01-25 18:55:23 -05:00
Yacin Tmimi
37489e43b6 Update how LD_LIBRARY_PATH is set for rustfmt binaries in diff check
rustfmt currently has a runtime dependency on the sysroot. So when we
build a standalone rustfmt binary we need to set `LD_LIBRARY_PATH` so
each rustfmt binary knows where to find it's dependencies.

When running our Diff-Check job to test PRs for breaking changes it's
often the case that both the master rustfmt binary and the feature
branch binary have the same runtime dependencies so we only need to
set `LD_LIBRARY_PATH` once.

However, when running the diff-check job against a subtree sync PR that
assumption doesn't hold. The subtree sync PR bumps the required
toolchain used to build rustfmt and therefore the binary that gets built
for the subtree sync PR has a different runtime dependency than the
master rustfmt binary.

Now we set `LD_LIBRARY_PATH` twice to account for this potential
difference.
2023-11-01 20:21:47 -05:00
Yacin Tmimi
b446e8eee5 update diff-check logging
These changes mostly improve logging out the cargo version and version
of the two rustfmt binaries that are compiled. Some other minor logging
changes were made as well to add some whitespace to improve visual
clarity when looking at the logs in the GitHub Actions console.
2023-11-01 20:21:47 -05:00
Yacin Tmimi
641d4f5898 Build nightly rustfmt using --all-features in CI
Previously we were only building rustfmt with default features in CI. We
recently received a report that rustfmt was unable to compile with the
`generic-simd` feature, which is not enabled by default. To prevent a
similar situation in the future we'll start build nightly rustfmt with
all features enabled.
2023-08-13 13:49:06 -05:00
Yacin Tmimi
d698bf4e1b use the branch_name as the default for the optional commit hash
There was an issue with the script when passing optional rustfmt configs
without specifying a commit hash. Because these optional values are
passed via positional arguments the configs ($4)  would be used in place
of the commit hash ($3). Now that we set a default value for the
optional commit hash we avoid this problem.
2023-07-11 19:10:59 -05:00
Yacin Tmimi
e5c212b56f Improve error discovery in check_diff.sh
The `set -e` option is used to immediately exit if any command exits
with a non zero exit status. This will help us catch errors in the
script, for example, needing the `LD_LIBRARY_PATH` to be set.
2023-07-11 19:10:59 -05:00
Yacin Tmimi
89500fab0e Add LD_LIBRARY_PATH in check_diff.sh
There were some upstream changes made a while back that requires this to
be set when building rustfmt from source like we do in the
`check_diff.sh` script.

See issue 5675 for more details.
2023-07-11 19:10:59 -05:00
Yuki Okushi
ad9fb89c30 Update Git repo URLs
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-11-05 19:51:01 -05:00
Yacin Tmimi
949da529d7 Add GitHub Action to test master rustfmt formatting vs a feature branch
This new action is intended to help us maintainers determine when feature
branches cause breaking formatting changes by running rustfmt (master)
and the feature branch on various rust repositories.

Over time I expect the list of checked projects to increase.

With this action in place we can more easily test that a new feature or
bug fix doesn't introduce breaking changes. Although this action needs to
be manually triggered right now, we might consider adding it to our CI
runs in the future.
2022-08-12 20:41:38 -05:00
Yacin Tmimi
b3d4fb448c Allow #[ignore] tests to run in rustfmt's test suite
There are some tests in the rustfmt test suite that are ignored by
default. I believe these tests are ignored because they have caused
issues with the the `rust-lang/rust` test suite.

However, we recently experienced an issue (5395) that would have been
avoided had these tests been running.

With the introduction of the new `#[rustfmt_only_ci_test]` attribute
macro we can run these tests when the `RUSTFMT_CI` environment variable
is set, which will presumably only be set during rustfmts CI runs.
When the environment variable is not set the `#[rustfmt_only_ci_test]`
will be replaced with an `#[ignore]`.
2022-06-29 18:55:02 -05:00
Tom Milligan
2c8b3bef2b
ci: include config_proc_macro crate in ci (#5389)
* config_proc_macro: fix failing doctests

* ci: include config_proc_macro crate in ci

* [review] working native windows ci

* [fix] add --locked file for ci

* [fix] quoting of cmd variables
2022-06-21 10:23:13 -05:00
Yacin Tmimi
1a6146e536 Pass --locked when installing rustfmt in integration tests
There was recently an issue where `cargo install` was installing a newer
version of a dependency than the one listed in our Cargo.toml. The newer
version added deprecation warnings that caused our continuous integration
tests to break.

As mentioned in the `cargo help install` docs, passing the `--locked`
flag should force cargo to use the `Cargo.lock` file included with
the repository.
2022-06-14 15:23:33 -05:00
Alexander Melentyev
71f01d1974 Delete spaces 2021-06-21 12:11:37 +03:00
Seiichi Uchida
577ef8136f
Update rustc-ap-* crates to 659.0.0 for rustfmt-1.4.15 (#4184) 2020-05-19 17:31:28 +09:00
Stéphane Campinas
31fbf34439
add check for failed tests 2019-04-15 12:01:49 +02:00
Stéphane Campinas
81a1d46723
exit integration test successfully if the crate build failed before applying rustfmt
The `cargo test --all` command failed and exited the main process with a
SIGINT. Trapping the signal or trying to get the code of a subshell
didn't work.

Close #2724
2019-04-15 11:33:11 +02:00
Stéphane Campinas
ee90de5746
show the HEAD of the integration branch to faciliate reproducing an error with rustfmt 2019-03-20 10:16:41 +01:00
topecongiro
d956980de4 Use edition 2018 2019-02-08 00:22:34 +09:00
Otavio Salvador
693a2fc23a CI: Rework integration script so only lib unit tests are run for crater
Refs: https://github.com/rust-lang-nursery/crater/issues/358

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2018-11-01 16:48:21 -03:00
Nick Cameron
b21a9c800c Fix the Failure integration test
Fixes #2858
2018-08-01 12:01:52 +12:00
Nick Cameron
a1c5c46986
Merge pull request #2793 from rust-lang-nursery/integr-test-fail
Don't fail integration tests if the subject is not passing its own tests
2018-06-19 10:40:21 +12:00
gnzlbg
cf1164ee7d do not fix chalk 2018-06-18 10:43:07 +02:00
Nick Cameron
46601a3435 Don't fail integration tests if the subject is not passing its own tests
As suggested in https://github.com/rust-lang-nursery/rustfmt/pull/2715#issuecomment-390397152
2018-06-18 20:17:07 +12:00
gnzlbg
dda964d0be fix chalk build 2018-06-18 10:04:21 +02:00
gnzlbg
3b65e15989 update issues; allow stdsimd to fail 2018-06-18 09:49:17 +02:00
gnzlbg
88a2c48ce3 preserve pipe error status (tee always succeeds); check fmt before running tests 2018-06-15 15:07:32 +02:00
gnzlbg
aacebc854a test cargo fmt --all -- --check returns success after formatting 2018-06-15 14:20:39 +02:00
Nick Cameron
9226a50b14 Fix and tweak integration tests 2018-05-21 08:58:53 +12:00
gnzlbg
c6c654517b try harder to print output 2018-05-18 10:46:14 +02:00
Nick Cameron
5fb987fff8 Fixup integration tests 2018-05-18 17:13:16 +12:00
Philipp Hansch
3ecac79c09
Shallow clone in integration tests
This should make cloning a bit faster for all the integration tests.
2018-05-16 19:15:51 +02:00
gnzlbg
4e8b5a7e6a output the result of rustfmt on ci 2018-05-15 19:55:56 +02:00
gnzlbg
c79f39af16 Add integration tests against crates in the rust-lang-nursery
This commit adds integration tests against some crates in the
nursery.

Each integration test is added as a separate build-bot, where
the rust-lang-nursery/${CRATE} is first downloaded and its tests run.
Afterwards, `cargo fmt --all` is applied to the crate, and the tests
are re-run. If the tests fail after formatting, the integration test
fails.

The crates that currently fail are added as allowed-to-fail, but the
intent is that either these crates or rustfmt should be fixed such
that the tests pass.
2018-05-10 00:31:55 +02:00