Skip to content

Commit

Permalink
Merge pull request #145 from DeterminateSystems/fix-broken-test
Browse files Browse the repository at this point in the history
Fix broken test
  • Loading branch information
lucperkins authored Dec 4, 2024
2 parents 9c9224a + bc88126 commit 9fb0807
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "flake-checker"
version = "0.2.0"
version = "0.2.1"
edition = "2021"

[workspace]
Expand Down
44 changes: 19 additions & 25 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.2405.*";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
crane = {
url = "https://flakehub.com/f/ipetkov/crane/0.17.*";
url = "https://flakehub.com/f/oxalica/rust-overlay/*";
inputs.nixpkgs.follows = "nixpkgs";
};
crane.url = "https://flakehub.com/f/ipetkov/crane/0.19.*";
};

outputs = { self, ... }@inputs:
Expand Down
4 changes: 3 additions & 1 deletion src/flake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ mod test {
fn cel_conditions() {
// (condition, expected)
let cases: Vec<(&str, bool)> = vec![
(include_str!("../tests/cel-condition.txt"), true),
(include_str!("../tests/cel-condition.cel"), true),
(

"has(gitRef) && has(numDaysOld) && has(owner) && has(supportedRefs) && supportedRefs.contains(gitRef) && owner != 'NixOS'",
Expand Down Expand Up @@ -189,6 +189,8 @@ mod test {
);

if expected {
println!("{result:?}");

assert!(result.is_ok());
assert!(result.unwrap().is_empty());
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/cel-condition.txt → tests/cel-condition.cel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
supportedRefs == ['nixos-24.05', 'nixos-24.05-small', 'nixos-unstable', 'nixos-unstable-small', 'nixpkgs-24.05-darwin', 'nixpkgs-unstable']
['nixos-unstable', 'nixos-unstable-small', 'nixpkgs-unstable'].map(rev, supportedRefs.contains(rev))
&& owner == 'NixOS'
&& gitRef == 'nixos-unstable'
&& supportedRefs.contains(gitRef)
Expand Down

0 comments on commit 9fb0807

Please sign in to comment.