Uh oh!
There was an error while loading. Please reload this page.
test: Stub in sharness framework - #180
Conversation
| ocitools generate --template template | jq . >actual && | ||
| cat <<-EOF >expected && | ||
| { | ||
| \"ociVersion\": \"1.0.0-rc1\", |
There was a problem hiding this comment.
I don't like the escaping that we do here :/
There was a problem hiding this comment.
On Wed, Aug 03, 2016 at 04:06:28PM -0700, Mrunal Patel wrote:
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+test_description='Test generate template'
+
+. ./sharness.sh
+
+test_expect_failure CAT,ECHO,HEAD,JQ 'Test ocitools generate --template with an empty template' "
- echo '{}' >template &&
- ocitools generate --template template | jq . >actual &&
- cat <<-EOF >expected &&
{\"ociVersion\": \"1.0.0-rc1\",I don't like the escaping that we do here :/
There are only so many quotes we can use ;). Would you rather me wrap
the test in single quotes and use double quotes inside it? That makes
using variables in the test tricky, but we don't do any of that yet.
liangchenye
commented
Aug 4, 2016
The sharness framework looks cool, I need time to absorb it. It is different test frame topic with #66, right? It is more like a unit test. If so, I think we |
wking
commented
Aug 4, 2016
On Thu, Aug 04, 2016 at 05:34:29AM -0700, 梁辰晔 (Liang Chenye) wrote:
Yes. That is about “how do we validate a runtime?” and this is about
The goal of this PR is to test the ocitools command line as a black |
liangchenye
commented
Aug 8, 2016
+1 for the black box test |
wking
commented
Oct 12, 2016
Is this dead, or worth a rebase? |
Mashimiao
commented
Oct 13, 2016
Compared with importing sharness, how about importing a go based framework, like go-check? |
On Wed, Oct 12, 2016 at 11:04:24PM -0700, Ma Shimiao wrote:
A shell-based test harness lets us use a very convenient API for ocitools --help | head -n2 >actual && |
Mashimiao
commented
Jul 19, 2017
Please contribute to master branch |
wking
commented
Jul 19, 2017
I can rebase onto master and change the target branch without filing a new PR and fragmenting discussion. Can you re-open this PR so I can do that? |
wking
commented
Jul 19, 2017
via email
| - git-validation -run DCO,short-subject -v -range ${TRAVIS_COMMIT_RANGE} | ||
| - make | ||
| - make test | ||
| - PATH="${PATH}:${PWD}" make -C test |
There was a problem hiding this comment.
I think this will be failed. As from test/README.md, we need do 'git submodule update --init' first. But you didn't do such preparation in travis.yml
There was a problem hiding this comment.
... we need do 'git submodule update --init' first.
Travis does that for us.
| # oci-runtime-tool integration tests | ||
| This project uses the [Sharness][] test harness, installed as a [Git | ||
| submodule]submodule]. To setup the test installation after a clone, |
There was a problem hiding this comment.
I'm missing a [ here. Will update later tonight.
Mashimiao
commented
Aug 2, 2017
I'm OK with this patchset, but generate related tests are all failed. Would you mind update these tests based on current generate output? |
wking
commented
Aug 2, 2017
They look like they passed to me. Can you link to what you'd like fixed? |
My local test result: |
wking
commented
Aug 2, 2017
Ah, I probably need to rebase around #431. |
It's GPLv2+ [1], so using a submodule keeps the separation from our Apache 2.0 source clear. And it's an isolated enough dependency that I prefer to keep the Git histories separate. Generated with: $ mkdir test $ git submodule add git://github.com/mlafeldt/sharness.git test/sharness $ (cd test/sharness && git checkout v1.0.0) $ git add test/sharness $ cd test $ ln -s sharness/aggregate-results.sh $ ln -s sharness/sharness.sh $ ln -s sharness/test/Makefile $ emacs README.md $ git add README.md Makefile sharness.sh aggregate-results.sh [1]: https://github.com/mlafeldt/sharness/tree/v1.0.0#license Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: W. Trevor King <wking@tremily.us>
Using jq to format the output so we don't have to worry about oci-runtime-tool's default tab indents or lack of trailing newlines, neither of which play nicely with <<-EOF here documents. Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: W. Trevor King <wking@tremily.us>
wking
commented
Aug 2, 2017
via email
On Wed, Aug 02, 2017 at 04:04:30AM +0000, W. Trevor King wrote:
Ah, I probably need to rebase around #431. |
Spun off from thisdiscussion. This currently ignores most of the
generateoptions and doesn't touchvalidateat all, but I thought I'd float it early for some feedback before sinking too much time into it. If the current work looks solid, I'm happy to land it now and follow up with additional PRs to fill it out, or to keep this PR open until the coverage is more complete.Details on the individual changes in the commit messages.