<commit_before>import ./make-test.nix ({ ... }:
{
  name = "snapper";

  machine = { pkgs, lib, ... }: {
    boot.initrd.postDeviceCommands = ''
      ${pkgs.btrfs-progs}/bin/mkfs.btrfs -f -L aux /dev/vdb
    '';

    virtualisation.emptyDiskImages = [ 4096 ];

    fileSystems = lib.mkVMOverride {
      "/home" = {
        device = "/dev/disk/by-label/aux";
        fsType = "btrfs";
      };
    };
    services.snapper.configs.home.subvolume = "/home";
    services.snapper.filters = "/nix";
  };

  testScript = ''
    $machine->succeed("btrfs subvolume create /home/.snapshots");

    $machine->succeed("snapper -c home list");

    $machine->succeed("snapper -c home create --description empty");

    $machine->succeed("echo test > /home/file");
    $machine->succeed("snapper -c home create --description file");

    $machine->succeed("snapper -c home status 1..2");

    $machine->succeed("snapper -c home undochange 1..2");
    $machine->fail("ls /home/file");

    $machine->succeed("snapper -c home delete 2");

    $machine->succeed("systemctl --wait start snapper-timeline.service");

    $machine->succeed("systemctl --wait start snapper-cleanup.service");
  '';
})
<commit_msg>nixos/snapper: port test to python<commit_after>import ./make-test-python.nix ({ ... }:
{
  name = "snapper";

  machine = { pkgs, lib, ... }: {
    boot.initrd.postDeviceCommands = ''
      ${pkgs.btrfs-progs}/bin/mkfs.btrfs -f -L aux /dev/vdb
    '';

    virtualisation.emptyDiskImages = [ 4096 ];

    fileSystems = lib.mkVMOverride {
      "/home" = {
        device = "/dev/disk/by-label/aux";
        fsType = "btrfs";
      };
    };
    services.snapper.configs.home.subvolume = "/home";
    services.snapper.filters = "/nix";
  };

  testScript = ''
    machine.succeed("btrfs subvolume create /home/.snapshots")
    machine.succeed("snapper -c home list")
    machine.succeed("snapper -c home create --description empty")
    machine.succeed("echo test > /home/file")
    machine.succeed("snapper -c home create --description file")
    machine.succeed("snapper -c home status 1..2")
    machine.succeed("snapper -c home undochange 1..2")
    machine.fail("ls /home/file")
    machine.succeed("snapper -c home delete 2")
    machine.succeed("systemctl --wait start snapper-timeline.service")
    machine.succeed("systemctl --wait start snapper-cleanup.service")
  '';
})

{'fraction_non_alphanumeric': 0.1750105174589819, 'fraction_numerical': 0.007572570466975179, 'mean_word_length': 2.817014446227929, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3479432', 'n_tokens_mistral': 832, 'n_tokens_neox': 788, 'n_words': 154}