Skip to content

Commit

Permalink
test: pass conv-params as a string instead of a YAML mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardosm committed Aug 9, 2024
1 parent 7030c39 commit dd2151a
Show file tree
Hide file tree
Showing 109 changed files with 110 additions and 111 deletions.
2 changes: 1 addition & 1 deletion convert-tests/defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub(crate) struct Test {
#[serde(rename = "svn-revs")]
pub(crate) svn_revs: Vec<SvnRev>,
#[serde(rename = "conv-params")]
pub(crate) conv_params: serde_yaml::Value,
pub(crate) conv_params: String,
#[serde(rename = "user-map")]
pub(crate) user_map: Option<String>,
#[serde(rename = "git-repack", default = "false_")]
Expand Down
3 changes: 1 addition & 2 deletions convert-tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ pub(crate) fn run_test(test_path: &Path) -> Result<(), String> {
}

let conv_params_path = temp_dir.join("conv-params.yaml");
let conv_params_raw = serde_yaml::to_string(&test_def.conv_params).unwrap();
std::fs::write(&conv_params_path, conv_params_raw.as_bytes())
std::fs::write(&conv_params_path, test_def.conv_params.as_bytes())
.map_err(|e| format!("failed to write {conv_params_path:?}: {e}"))?;

let svn_dump_path = temp_dir.join("svn-dump");
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/branched-unbranched.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ svn-revs:
action: add
text: "z\n"

conv-params:
conv-params: |
branches:
- trunk
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/copy-nonbranch-to-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ svn-revs:
action: add
copy-from-path: trunk

conv-params:
conv-params: |
branches:
- branches/*
rename-branches:
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/copy-nonbranch-to-parent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ svn-revs:
action: add
copy-from-path: branches1

conv-params:
conv-params: |
branches:
- branches2/*
head: branches2/b1
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/copy-one-to-nonbranch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ svn-revs:
action: add
copy-from-path: trunk

conv-params:
conv-params: |
branches:
- trunk
rename-branches:
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/copy-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ svn-revs:
action: add
copy-from-path: trunk

conv-params:
conv-params: |
branches:
- trunk
- branches/*
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/copy-parent-to-nonbranch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ svn-revs:
action: add
copy-from-path: branches1

conv-params:
conv-params: |
branches:
- branches1/*
head: branches1/b1
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/copy-parent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ svn-revs:
action: add
copy-from-path: branches1

conv-params:
conv-params: |
branches:
- branches1/*
- branches2/*
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/copy-replace-parent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ svn-revs:
action: replace
copy-from-path: branches1

conv-params:
conv-params: |
branches:
- branches1/*
- branches2/*
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/delete-keep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ svn-revs:
kind: dir
action: delete

conv-params:
conv-params: |
branches:
- trunk
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/delete-not-keep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ svn-revs:
kind: dir
action: delete

conv-params:
conv-params: |
branches:
- trunk
- branches/*
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/delete-twice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ svn-revs:
kind: dir
action: delete

conv-params:
conv-params: |
branches:
- trunk
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/merge-after-cherrypick.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ svn-revs:
action: add
text: "file D\n"

conv-params:
conv-params: |
branches:
- trunk
- branches/*
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/merge-allowed-gap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ svn-revs:
action: add
text: "file B\n"

conv-params:
conv-params: |
branches:
- trunk
- branches/*
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/merge-and-keep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ svn-revs:
action: add
text: "file D\n"

conv-params:
conv-params: |
branches:
- trunk
- branches/*
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/merge-and-revert-keep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ svn-revs:
kind: file
action: delete

conv-params:
conv-params: |
branches:
- trunk
- branches/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ svn-revs:
kind: file
action: delete

conv-params:
conv-params: |
branches:
- trunk
- branches/*
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/merge-during-create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ svn-revs:
action: add
text: "file C\n"

conv-params:
conv-params: |
branches:
- trunk
- branches/*
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/merge-simple-ignore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ svn-revs:
action: add
text: "file C\n"

conv-params:
conv-params: |
branches:
- trunk
- branches/*
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/merge-simple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ svn-revs:
action: add
text: "file C\n"

conv-params:
conv-params: |
branches:
- trunk
- branches/*
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/merge-twice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ svn-revs:
action: add
text: "file C\n"

conv-params:
conv-params: |
branches:
- trunk
- branches/*
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/merge-with-cherrypick.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ svn-revs:
action: add
text: "file E\n"

conv-params:
conv-params: |
branches:
- trunk
- branches/*
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/not-merge-gap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ svn-revs:
action: add
text: "file C\n"

conv-params:
conv-params: |
branches:
- trunk
- branches/*
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/recover-one.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ svn-revs:
copy-from-rev: 1
copy-from-path: trunk

conv-params:
conv-params: |
branches:
- trunk
- trunk2
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/recover-parent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ svn-revs:
copy-from-rev: 1
copy-from-path: branches1

conv-params:
conv-params: |
branches:
- branches1/*
- branches2/*
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/recreate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ svn-revs:
action: add
text: "y\n"

conv-params:
conv-params: |
branches:
- trunk
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/branches/unbranched-custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ svn-revs:
action: add
text: "y\n"

conv-params:
conv-params: |
head: ""
unbranched-name: onebranch
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/commit-meta/custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ svn-revs:
action: add
text: "y\n"

conv-params:
conv-params: |
branches:
- trunk
user-map-file: user-map.txt
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/commit-meta/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ svn-revs:
action: change
text: "z\n"

conv-params:
conv-params: |
branches:
- trunk
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/copy-root.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ svn-revs:
action: add
copy-from-path: ""

conv-params:
conv-params: |
branches:
- branches/*
- backup/branches/*
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/delete-files-branched.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ svn-revs:
action: add
copy-from-path: trunk/y

conv-params:
conv-params: |
branches:
- trunk
delete-files:
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/delete-files-unbranched.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ svn-revs:
action: add
copy-from-path: y

conv-params:
conv-params: |
head: ""
delete-files:
- "**/y"
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/dump-sources/compressed-bzip2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ svn-revs:
action: add
text: "y\n"

conv-params:
conv-params: |
branches:
- trunk
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/dump-sources/compressed-gzip.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ svn-revs:
action: add
text: "y\n"

conv-params:
conv-params: |
branches:
- trunk
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/dump-sources/compressed-lz4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ svn-revs:
action: add
text: "y\n"

conv-params:
conv-params: |
branches:
- trunk
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/dump-sources/compressed-xz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ svn-revs:
action: add
text: "y\n"

conv-params:
conv-params: |
branches:
- trunk
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/dump-sources/compressed-zstd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ svn-revs:
action: add
text: "y\n"

conv-params:
conv-params: |
branches:
- trunk
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/dump-sources/uncompressed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ svn-revs:
action: add
text: "y\n"

conv-params:
conv-params: |
branches:
- trunk
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/fail/change-non-existing-file.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ svn-revs:
action: change
text: "x\n"

conv-params:
conv-params: |
branches:
- trunk
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/fail/copy-file-as-dir.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ svn-revs:
action: add
copy-from-path: trunk/x

conv-params:
conv-params: |
branches:
- trunk
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/fail/copy-from-non-existing-path.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ svn-revs:
copy-from-rev: 1
copy-from-path: trunk/y

conv-params:
conv-params: |
branches:
- trunk
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/fail/copy-from-non-existing-rev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ svn-revs:
copy-from-rev: 3
copy-from-path: trunk/y

conv-params:
conv-params: |
branches:
- trunk
Expand Down
2 changes: 1 addition & 1 deletion convert-tests/tests/fail/delete-non-existing-file.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ svn-revs:
kind: file
action: delete

conv-params:
conv-params: |
branches:
- trunk
Expand Down
Loading

0 comments on commit dd2151a

Please sign in to comment.