atomist-attic / rug

DEPRECATED Runtime for Rugs
GNU General Public License v3.0
53 stars 13 forks source link

Ignore tests scenarios under node_modules #629

Closed ddgenome closed 7 years ago

ddgenome commented 7 years ago

rug-cli-1.0.0-m.3 is trying to run Gherkin features and scenarios it finds under .atomist/node_modules. It should not do that.

kipz commented 7 years ago

Do you have an example of this? Looking at the code, it seems like it only loads Gherkin tests from .atomist/tests

https://github.com/atomist/rug/blob/master/src/main/scala/com/atomist/rug/test/gherkin/GherkinRunner.scala#L37

ddgenome commented 7 years ago

Does that test anchor the path it is looking under? The scenarios that caused the problem were under .atomist/node_modules/@atomist/microgrammer-internal/.atomist/tests.

kipz commented 7 years ago

Thanks, that helps. I'll check, but I suspect you're right and it's not anchored at the root.

ddgenome commented 7 years ago

It looks like it is: https://github.com/atomist/rug/blob/master/src/main/scala/com/atomist/project/archive/AtomistConfig.scala#L75

I'll try to recreate and provide instructions.

kipz commented 7 years ago

It looks like this should be using findChildDirectory instead:

https://github.com/atomist/rug/blob/master/src/main/scala/com/atomist/project/archive/AtomistConfig.scala#L59

ddgenome commented 7 years ago

You can recreate this problem in any Rug project with the following instructions.

$ rug --version
rug 1.0.0-m.3
https://github.com/atomist/rug-cli.git (git revision fae804e; last commit 2017-06-01)
$ mkdir -p node_modules/@atomist/junk/.atomist/tests/project
$ echo -e "Feature: nothing\n  Junk\n\n  Scenario: some scenario\n    Given missing\n    When missing\n    Then missing" > !$/Junk.feature
$ rug test
...
  Not yet implemented
  └─┬ nothing
    └─┬ some scenario
      ├── missing: NotYetImplemented
      ├── missing: NotYetImplemented
      └── missing: NotYetImplemented