-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Validate manifests against JSON Schema in CI Tests #1331
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try installing a specific version that works locally.
Nope doesn't work either
|
Sorry, I can't help here. |
Is it possible that the AppVeyor build environment already has an older version of Is it worth adding something like this after you run the
|
Nice good idea! But Newtonsoft.Json.Schema is not installed ... Other strange things:
So i guess PS 5.1 can use static extensions, but 5.0 can't ... Also using IsValid as an extension doesn't work because $manifest is now of type
Or should i write it as a small C# validation tool (like shim.exe)? |
Try calling it using the static class?
|
test/Scoop-Manifest.Tests.ps1
Outdated
$json = gc "$working_dir\invalid_wget.json" -raw -Encoding UTF8 | ||
$manifest = [Newtonsoft.Json.Linq.JToken]::Parse($json) | ||
$schema = [Newtonsoft.Json.Schema.JSchema]::Parse($schema_json) | ||
[Newtonsoft.Json.Schema.SchemaExtensions]::IsValid($manifest, $schema, [ref]$validationErrors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already doing that
Okay i have written a small c# tool for validating the manifests. I will try it with a custom library now... 馃槃 |
* Added validator.exe as a single file validation tool * Added Scoop.Validator Lib for use in Manifest-Tests and validator.exe * Exclude .dll and packages folder from Project-Tests Add buildscript for Scoop.Validator and validator.exe
Curse you Appveyor! Again: no idea ... |
Wow, that's frustrating. Could it be an x86/x64 difference between what AppVeyor is using and what the Scoop.Validator.dll is targeting? Would setting a platform in appveyor.yml make a difference, or making Scoop.Validator.dll match whatever platform the Newtonsoft dlls target? |
If you can't get it working, perhaps consider using python for this test, as https://github.com/rasa/scoops/blob/master/validate.py is MIT licensed. |
Ah nice 馃憤
|
Sorry, I've only tested it with Python 2.7.13. Remove the
and it should work in Python 3 |
Yup that worked. I'm going to redo this in python tomorrow or so. I hope that works on appveyor. 馃榾 |
Apparently git has desided to destroy all dll files:
Edit: Aah the .gitattributes might be the problem. *.dll is not set. |
Eureka! It works! |
Two thoughts:
|
Added some changes to the schema in #1342 |
I am implementing manifest validation against the JSON Schema using dlls from Newtonsoft.Json.Schema.
Currently it works on my machine, but it fails on appveyor. (See my build log or the log of this PR)
Could this have anything to do with different powershell or .NET versions?
PS on appveyor:
PS on my machine:
I have no idea why this error
Cannot find an overload for "IsValid" and the argument count: "3".
pops up.Any ideas? 馃槃