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

"ui" testing #20

Closed
oli-obk opened this issue Aug 18, 2020 · 3 comments · Fixed by #21
Closed

"ui" testing #20

oli-obk opened this issue Aug 18, 2020 · 3 comments · Fixed by #21

Comments

@oli-obk
Copy link
Collaborator

oli-obk commented Aug 18, 2020

In rustc and clippy we're using the compiletest-rs framework for committing the output of programs (in that case error messages) to git so we see diffs in PRs and realize if we do accidental changes. It's not trivial to maintain (causes breakage every now and then, uses nightly, probably causes your CI time to go up significantly), but it's very powerful.

Alternatively we could just write tests that write to files that are commited if a specific env var is set and otherwise tests whether the files are the same (so on CI).

Are you interested in either framework for testing the rendered output?

@davidbarsky
Copy link
Owner

I wasn't successful in setting up compiletest in the past, but it seems really powerful. I'll happily accept a PR if you have one, nightly and all.

@oli-obk oli-obk mentioned this issue Aug 20, 2020
@matklad
Copy link
Contributor

matklad commented Aug 21, 2020

Incidentally, I've been doing something in this area for rustc, so cc

rust-lang/rust#75773

It's unlikely that this fits this use-case, but might be good to know regardless.

@davidbarsky
Copy link
Owner

Thanks @matklad! I think the inline feature of rust-analyzer's snapshot tests is neat, but I'm not sure this crate reached the point where inline snapshot testing is worthwhile. But it's good to know!

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 a pull request may close this issue.

3 participants