Skip to content

Commit 0723847

Browse files
committed
seperate test dirs by attrset
1 parent 089c99a commit 0723847

File tree

229 files changed

+24
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+24
-6
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ jobs:
5050
- uses: serokell/xrefcheck-action@v1
5151
with: # Invalid symlinks for testing purposes.
5252
xrefcheck-args: >
53-
--ignore tests/symlink-invalid/main/pkgs/by-name/fo/foo/foo
54-
--ignore tests/multiple-failures/main/pkgs/by-name/A/fo@/foo
53+
--ignore tests/top-level/symlink-invalid/main/pkgs/by-name/fo/foo/foo
54+
--ignore tests/top-level/multiple-failures/main/pkgs/by-name/A/fo@/foo

src/main.rs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,28 @@ mod tests {
307307

308308
use super::process;
309309

310-
#[fixtures::fixtures(["tests/*"])]
310+
// Manually repeat this for each subdir under tests/ in order to disambiguate
311+
#[fixtures::fixtures(["tests/top-level/*"])]
311312
#[allow(non_snake_case)] // the test directories don't use snake case, and the macro expansion causes a warning.
312313
#[test]
313-
fn test_dir(path: &Path) -> anyhow::Result<()> {
314+
fn test_top_level_dir(path: &Path) -> anyhow::Result<()> {
315+
let name = path.file_name().unwrap().to_string_lossy().into_owned();
316+
if !path.is_dir() {
317+
return Ok(());
318+
}
319+
320+
let expected_errors = fs::read_to_string(path.join("expected"))
321+
.with_context(|| format!("No expected file for test {name}"))?;
322+
323+
test_nixpkgs(&name, path, &expected_errors);
324+
Ok(())
325+
}
326+
327+
// Manually repeat this for each subdir under tests/ in order to disambiguate
328+
#[fixtures::fixtures(["tests/tcl/*"])]
329+
#[allow(non_snake_case)] // the test directories don't use snake case, and the macro expansion causes a warning.
330+
#[test]
331+
fn test_tcl_dir(path: &Path) -> anyhow::Result<()> {
314332
let name = path.file_name().unwrap().to_string_lossy().into_owned();
315333
if !path.is_dir() {
316334
return Ok(());
@@ -382,7 +400,7 @@ mod tests {
382400
temp_env::with_var("TMPDIR", Some(&tmpdir), || {
383401
test_nixpkgs(
384402
"symlinked_tmpdir",
385-
Path::new("tests/success"),
403+
Path::new("tests/top-level/success"),
386404
"Validated successfully\n",
387405
);
388406
});
@@ -406,7 +424,7 @@ mod tests {
406424
let base_nixpkgs = if base_path.exists() {
407425
base_path
408426
} else {
409-
Path::new("tests/empty-base/main").to_owned()
427+
Path::new("tests/top-level/empty-base/main").to_owned()
410428
};
411429

412430
// Empty dir, needed so that no warnings are printed when testing older Nix versions
File renamed without changes.

tests/aliases/main/pkgs/by-name/fo/foo/package.nix renamed to tests/tcl/new-non-by-name/base/pkgs/development/tcl-modules/by-name/tc/tclcurl/package.nix

File renamed without changes.

tests/tcl-new-non-by-name/base/pkgs/top-level/tcl-packages.nix renamed to tests/tcl/new-non-by-name/base/pkgs/top-level/tcl-packages.nix

File renamed without changes.
File renamed without changes.

tests/alt-callPackage/main/pkgs/by-name/fo/foo/package.nix renamed to tests/tcl/new-non-by-name/main/pkgs/development/tcl-modules/by-name/tc/tclcurl/package.nix

File renamed without changes.

tests/internalCallPackage/main/foo.nix renamed to tests/tcl/new-non-by-name/main/pkgs/development/tcl-modules/foo.nix

File renamed without changes.

tests/tcl-new-non-by-name/main/pkgs/top-level/tcl-packages.nix renamed to tests/tcl/new-non-by-name/main/pkgs/top-level/tcl-packages.nix

File renamed without changes.

0 commit comments

Comments
 (0)