Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create golden standards to test against json schema #34

Closed
stevvooe opened this issue Apr 15, 2016 · 10 comments
Closed

Create golden standards to test against json schema #34

stevvooe opened this issue Apr 15, 2016 · 10 comments

Comments

@stevvooe
Copy link
Contributor

We need a few "golden standards" to test against the json schema specs to catch unintentional changes. It will also help in having them as part of PRs that show the schema change and how it affects the "golden standard".

@vbatts Thoughts?

@philips
Copy link
Contributor

philips commented Apr 15, 2016

+1 on that. It would be nice to have it test both the markdown embedded and examples but that is more of a nice to have.

@vbatts
Copy link
Member

vbatts commented Apr 16, 2016

So we could add the files from the embedded markdown examples as files, and have a test target against them.
https://gist.github.com/vbatts/b3e4fc231fbc92a9cbc28b9184f0b2d2 is what I was using when writing the schema.

I'm not really sure of a clean way to work with the examples while they're embedded in the markdown though.

@wking
Copy link
Contributor

wking commented Apr 16, 2016

On Sat, Apr 16, 2016 at 07:57:13AM -0700, Vincent Batts wrote:

I'm not really sure of a clean way to work with the examples while
they're embedded in the markdown though.

Probably just make sure all embedded examples are subsets of the
stand-alone example JSON. It shouldn't be too hard to pull out the
JSON blocks by looking for ‘json’ and ‘’ delimiters, and then
checking to see if that snippet is contained in one of a set of
stand-alone files. If this approach sounds useful, I'm happy to write
tooling for it (although it would probably be in Python ;).

@philips
Copy link
Contributor

philips commented Apr 20, 2016

@stevvooe Are you going to work on this?

@stevvooe
Copy link
Contributor Author

I can look into it, but I'm not very familiar with JSONSchema. If anyone could suggest tools or an approach, that would be helpful.

I'll probably just use a Go package and a Makefile, barring common tools above.

@wking
Copy link
Contributor

wking commented Apr 20, 2016

On Wed, Apr 20, 2016 at 03:56:44PM -0700, Stephen Day wrote:

I can look into it, but I'm not very familiar with JSONSchema. If
anyone could suggest tools or an approach, that would be helpful.

#18 and #32 already landed the JSON Schema and Go tooling for
validating stand-alone JSON 1, so you probably don't need to write
new stuff there. There's a README for that approach in 2, if that
helps get you started.

You will need to add the example JSON manifests, etc. that are used to
test the schema, and some tooling to run validate.go against the
example manifests, etc.

@stevvooe
Copy link
Contributor Author

@wking Thanks!

validate.go should be sufficient to get started. Do we want to consider the specification to be the source of all golden standards?

@stevvooe
Copy link
Contributor Author

Took a small pass at this in #41.

#41 proposes maintaining examples in specifications. All examples are a part of the specification, rather than maintaining them in external files.

If we like that approach, I can round out that PR and we can move forward.

@vbatts
Copy link
Member

vbatts commented Apr 22, 2016

I like it.

On Thu, Apr 21, 2016 at 8:42 PM, Stephen Day notifications@github.com
wrote:

Took a small pass at this in #41
#41.

#41 #41 proposes
maintaining examples in specifications. All examples are a part of the
specification, rather than maintaining them in external files.

If we like that approach, I can round out that PR and we can move forward.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#34 (comment)

@vbatts
Copy link
Member

vbatts commented Apr 22, 2016

Also, it would dictate that a new item for the style.md showing how to do
the mime-type json examples.

On Fri, Apr 22, 2016 at 10:39 AM, Vincent Batts vbatts@hashbangbash.com
wrote:

I like it.

On Thu, Apr 21, 2016 at 8:42 PM, Stephen Day notifications@github.com
wrote:

Took a small pass at this in #41
#41.

#41 #41 proposes
maintaining examples in specifications. All examples are a part of the
specification, rather than maintaining them in external files.

If we like that approach, I can round out that PR and we can move forward.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#34 (comment)

wking added a commit to wking/image-spec that referenced this issue Jun 9, 2017
It's covered this since opencontainers/go-digest@4ca13015 (disallow
upper characters (/A-F/) in hex-encoded portion, 2017-05-12, opencontainers#34), so
we don't need to do it locally.  Also, use a more specific check for
ignoring unrecognized algorithms, because we don't want to return nil
when go-digest notices an invalid encoding, etc.

Signed-off-by: W. Trevor King <wking@tremily.us>
wking added a commit to wking/image-spec that referenced this issue Jun 9, 2017
It's covered this since opencontainers/go-digest@4ca13015 (disallow
upper characters (/A-F/) in hex-encoded portion, 2017-05-12, opencontainers#34), so
we don't need to do it locally.  Also, use a more specific check for
ignoring unrecognized algorithms, because we don't want to return nil
when go-digest notices an invalid encoding, etc.

Signed-off-by: W. Trevor King <wking@tremily.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants