Skip to content

Commit

Permalink
tests: remove now superfluous substitution of schema
Browse files Browse the repository at this point in the history
  • Loading branch information
nikstur committed Mar 8, 2024
1 parent d4cffb6 commit acdaa6a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions nix/tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,11 @@ let
sha256 = "sha256-N9aEK2oYk3SoCczrRMt5ycdgXCPA5SHTKsS2CffFY14=";
};

# To avoid network access, the base URL is replaced with a local URI to the above downloaded schemas
name = "bom-1.4.schema.json";
relativeReferencesSchema = pkgs.runCommand name { } ''
substitute "${cycloneDxSpec}/schema/${name}" "$out" \
--replace 'http://cyclonedx.org/schema/${name}' 'file://${cycloneDxSpec}/schema/'
'';

buildBomAndValidate = drv: options:
pkgs.runCommand "${drv.name}-bom-validation" { nativeBuildInputs = [ pkgs.check-jsonschema ]; } ''
check-jsonschema \
--schemafile "${relativeReferencesSchema}" \
--schemafile "${cycloneDxSpec}/schema/bom-1.4.schema.json" \
--base-uri "${cycloneDxSpec}/schema/bom-1.4.schema.json" \
"${buildBom drv options}"
touch $out
'';
Expand Down

0 comments on commit acdaa6a

Please sign in to comment.