Skip to content

Commit 1de8682

Browse files
committed
Move tooling into crates/ directory
This seems a little cleaner, especially if more tooling is added in the form of little one-off crates.
1 parent 00b7b07 commit 1de8682

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

Diff for: .github/workflows/snapshot_tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ jobs:
2020
- run: git fetch --depth 2
2121
- run: git checkout origin/master
2222
- name: Generate good snapshots
23-
run: INSTA_OUTPUT=none INSTA_UPDATE=always cargo test -- --include-ignored
23+
run: INSTA_OUTPUT=none INSTA_UPDATE=always cargo test -p snapshot -- --include-ignored
2424
- run: git checkout $GITHUB_SHA # merge of master+branch
25-
- run: cargo test -- --include-ignored
25+
- run: INSTA_OUTPUT=none INSTA_UPDATE=no cargo test -p snapshot -- --include-ignored

Diff for: .gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
/static/styles/fonts.css
1919
/static/styles/noscript.css
2020

21-
/snapshot/src/snapshots
21+
/crates/snapshot/src/snapshots

Diff for: Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[workspace]
22
resolver = "3"
3-
members = ["front_matter", "snapshot"]
3+
members = ["crates/front_matter", "crates/snapshot"]

Diff for: README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@ You can also run these tests locally for a faster feedback cycle:
6565

6666
- Generate the good snapshots to compare against, usually based off the master branch:
6767
```sh
68-
cargo insta test --accept --include-ignored
68+
cargo insta test -p snapshot --accept --include-ignored
6969
```
7070
Consider making a commit with these snapshots, so you can always check the diff of your changes with git:
7171
```sh
72-
git add --force snapshot/src/snapshots # snapshots are ignored by default
72+
git add --force crates/snapshot/src/snapshots # snapshots are ignored by default
7373
git commit --message "WIP add good snapshots"
7474
```
7575
Since we can't merge the snapshots to main, don't forget to drop this commit when opening a pull request.
7676

7777
- Compare the output of the branch you're working on with the good snapshots:
7878
```sh
79-
cargo insta test --review --include-ignored
79+
cargo insta test -p snapshot --review --include-ignored
8080
```
File renamed without changes.

Diff for: front_matter/src/lib.rs renamed to crates/front_matter/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ The post {post} has abnormal front matter.
255255
}
256256

257257
fn all_posts() -> impl Iterator<Item = PathBuf> {
258-
walkdir::WalkDir::new(concat!(env!("CARGO_MANIFEST_DIR"), "/../content"))
258+
walkdir::WalkDir::new(concat!(env!("CARGO_MANIFEST_DIR"), "/../../content"))
259259
.into_iter()
260260
.filter_map(|e| e.ok().map(|e| e.into_path()))
261261
.filter(|p| {
File renamed without changes.

Diff for: snapshot/src/lib.rs renamed to crates/snapshot/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[test]
22
fn snapshot() {
3-
std::env::set_current_dir(concat!(env!("CARGO_MANIFEST_DIR"), "/..")).unwrap();
3+
std::env::set_current_dir(concat!(env!("CARGO_MANIFEST_DIR"), "/../..")).unwrap();
44
let _ = std::fs::remove_dir_all("public");
55
let status = std::process::Command::new("zola")
66
.arg("build")
@@ -11,7 +11,7 @@ fn snapshot() {
1111
let timestamped_files = ["releases.json", "feed.xml"];
1212
let inexplicably_non_deterministic_files =
1313
["2023/08/07/Rust-Survey-2023-Results/experiences.png"];
14-
insta::glob!("../..", "public/**/*", |path| {
14+
insta::glob!("../../..", "public/**/*", |path| {
1515
if path.is_dir() {
1616
return;
1717
}

0 commit comments

Comments
 (0)