File tree 8 files changed +10
-10
lines changed
8 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 20
20
- run : git fetch --depth 2
21
21
- run : git checkout origin/master
22
22
- 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
24
24
- 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
Original file line number Diff line number Diff line change 18
18
/static /styles /fonts.css
19
19
/static /styles /noscript.css
20
20
21
- /snapshot /src /snapshots
21
+ /crates / snapshot /src /snapshots
Original file line number Diff line number Diff line change 1
1
[workspace ]
2
2
resolver = " 3"
3
- members = [" front_matter" , " snapshot" ]
3
+ members = [" crates/ front_matter" , " crates/ snapshot" ]
Original file line number Diff line number Diff line change @@ -65,16 +65,16 @@ You can also run these tests locally for a faster feedback cycle:
65
65
66
66
- Generate the good snapshots to compare against, usually based off the master branch:
67
67
``` sh
68
- cargo insta test --accept --include-ignored
68
+ cargo insta test -p snapshot - -accept --include-ignored
69
69
```
70
70
Consider making a commit with these snapshots, so you can always check the diff of your changes with git:
71
71
``` 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
73
73
git commit --message " WIP add good snapshots"
74
74
```
75
75
Since we can't merge the snapshots to main, don't forget to drop this commit when opening a pull request.
76
76
77
77
- Compare the output of the branch you're working on with the good snapshots:
78
78
``` sh
79
- cargo insta test --review --include-ignored
79
+ cargo insta test -p snapshot - -review --include-ignored
80
80
```
File renamed without changes.
Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ The post {post} has abnormal front matter.
255
255
}
256
256
257
257
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" ) )
259
259
. into_iter ( )
260
260
. filter_map ( |e| e. ok ( ) . map ( |e| e. into_path ( ) ) )
261
261
. filter ( |p| {
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
#[ test]
2
2
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 ( ) ;
4
4
let _ = std:: fs:: remove_dir_all ( "public" ) ;
5
5
let status = std:: process:: Command :: new ( "zola" )
6
6
. arg ( "build" )
@@ -11,7 +11,7 @@ fn snapshot() {
11
11
let timestamped_files = [ "releases.json" , "feed.xml" ] ;
12
12
let inexplicably_non_deterministic_files =
13
13
[ "2023/08/07/Rust-Survey-2023-Results/experiences.png" ] ;
14
- insta:: glob!( "../.." , "public/**/*" , |path| {
14
+ insta:: glob!( "../../.. " , "public/**/*" , |path| {
15
15
if path. is_dir( ) {
16
16
return ;
17
17
}
You can’t perform that action at this time.
0 commit comments