[Feature Req] Exclude files from lower layers #214

Open
chuckbutler opened this Issue May 31, 2016 · 3 comments

Comments

Projects
None yet
3 participants
Contributor

chuckbutler commented May 31, 2016

Checklist

  • Confirmed this is an issue with charm-tools, not charmstore-client
  • Provide versions of tools used
  • Described the feature or ways to replicate the issue

What version am I running?

I ran the following command: charm version and got the following ouput:

charm 2.1.1-0ubuntu1
charm-tools 2.1.2

I am using: Ubuntu 16.04

Issue/Feature

The ability to exclude files without overriding them in the top most layer. Some layers include singleton style tests (in amulet style) and the layers assume they can be built as their own stand alone entity. I don't always want to include these tests in my final output charm, as there are other tests flexing the capability, so including them is actually burdensome as it only extends the testing time.

A prime example case would be where i use a tests.yaml in my top most layer, and a lower layer includes a 00-setup. Or i'm testing a tis-terminated endpoint which is flexing the tls layer, meanwhile the tis-layer includes simple CA/Server certificate verification as a stand-alone test.

Contributor

bcsaller commented May 31, 2016

charm build supports an 'ignores' keyword in the layers config. This is a
list following the gitignore std pattern. In fact build should be ignoring
things that are in your .gitignore already. What either you or charm build
has backwards is that currently the layer above the layer your 1 off test
is in is what makes the choice to include it or not. Rather than a "should
I push this forward during merge" mentality the thinking is, if it is in
the layer it is there for a reason, I am only one possible consumer of that
layer. If that layer wants to ignore those tests that is its business.

I'm happy to discuss treating it the other way (which might be odd) or both
(which seems perhaps too complex). However the gist of that talk from my
side would be that if the test can't or shouldn't run in the output layer
it might be structured wrong, or testing something too specific to the
intermediate code if that isn't how it would be consumed.

On Mon, May 30, 2016 at 9:12 PM Charles Butler notifications@github.com
wrote:

Checklist

  • Confirmed this is an issue with charm-tools, not charmstore-client
  • Provide versions of tools used
  • Described the feature or ways to replicate the issue

What version am I running?

I ran the following command: charm version and got the following ouput:

charm 2.1.1-0ubuntu1
charm-tools 2.1.2

I am using: Ubuntu 16.04
Issue/Feature

The ability to exclude files without overriding them in the top most
layer. Some layers include singleton style tests (in amulet style) and the
layers assume they can be built as their own stand alone entity. I don't
always want to include these tests in my final output charm, as there are
other tests flexing the capability, so including them is actually
burdensome as it only extends the testing time.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#214, or mute the thread
https://github.com/notifications/unsubscribe/AAGVhZWKlC8SUXTlV_nEl2qNqsL4Enlkks5qG7UUgaJpZM4IqKeO
.

Contributor

chuckbutler commented May 31, 2016

I didn't know about the ignores keyword! I did think it was excludes at some point, and that has the same effect of nothing.

I feel like this was the right approach to take however, listing it in the layer.yaml - I think thats an idiomatic path for developers to look at what I'm doing with extant layers that is not otherwise defined on the filesystem (eg: overrides)

I did try the ignores keyword and it doesn't seem to be doing what I expect it to be doing:

includes:
  - 'layer:basic'
  - 'layer:tls'
  - 'interface:etcd'
  - 'interface:etcd-proxy'
ignores: ['Makefile', 'tests/10-tls-deploy.py', 'tests/00-setup']
repo: https://github.com/juju-solutions/layer-etcd.git

Yet when i list the output directory of the assembled charm:

ls etcd/tests
00-setup  10-tls-deploy.py  20-deploy  tests.yaml
Member

johnsca commented Jul 19, 2016

The key is ignore (singular). The ignore functionality is improved (and documented) in #235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment