Skip to content

Commit

Permalink
Add a test, clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
bilus committed Nov 1, 2021
1 parent 3cab0dd commit 880adbf
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 7 deletions.
103 changes: 101 additions & 2 deletions features/expose.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Scenario: Expose tasks
"""

@current
Scenario: Never overwrite existing an task when exposing tasks
Given file ./Oyafile containing
"""
Expand Down Expand Up @@ -66,7 +65,6 @@ Scenario: Never overwrite existing an task when exposing tasks
"""

@current
Scenario: Show task as exposed when listing tasks
Given file ./Oyafile containing
"""
Expand Down Expand Up @@ -97,3 +95,104 @@ Scenario: Show task as exposed when listing tasks
oya run p.echo
"""

Scenario: Tasks exposed in imported subdirs carry over when imported
Given file ./Oyafile containing
"""
Project: main
"""
And file ./project1/Oyafile containing
"""
Values:
foo: project1
echo: |
echo "project1"
"""
And file ./project2/Oyafile containing
"""
Import:
p1: /project1
Expose: p1
"""
And file ./project3/Oyafile containing
"""
Import:
p2: /project2
Expose: p2
"""
And I'm in the ./project3 dir
When I run "oya run echo"
Then the command succeeds
And the command outputs
"""
project1
"""

Scenario: Tasks exposed in imported packs carry over when imported
Given file ./Oyafile containing
"""
Project: main
Require:
github.com/tooploox/pack3: v1.0.0
# Use replace so we don't have to host it on github.
Replace:
github.com/tooploox/pack3: /tmp/pack3
Import:
pack3: github.com/tooploox/pack3
Expose: pack3
"""
And file /tmp/pack1/Oyafile containing
"""
Project: github.com/tooploox/pack1
echo: |
echo "pack1"
"""
And file /tmp/pack2/Oyafile containing
"""
Project: github.com/tooploox/pack2
Require:
github.com/tooploox/pack1: v1.0.0
# Use replace so we don't have to host it on github.
Replace:
github.com/tooploox/pack1: /tmp/pack1
Import:
p1: github.com/tooploox/pack1
Expose: p1
"""
And file /tmp/pack3/Oyafile containing
"""
Project: github.com/tooploox/pack3
Require:
github.com/tooploox/pack2: v1.0.0
# Use replace so we don't have to host it on github.
Replace:
github.com/tooploox/pack2: /tmp/pack2
Import:
p2: github.com/tooploox/pack2
Expose: p2
"""
And I'm in the ./ dir
When I run "oya run echo"
Then the command succeeds
And the command outputs
"""
pack1
"""
2 changes: 0 additions & 2 deletions features/import.feature
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ Scenario: Import a pack with alias from a parameter
"""

@current
Scenario: Import a pack and expose it
Given file ./Oyafile containing
"""
Expand All @@ -158,7 +157,6 @@ Scenario: Import a pack and expose it
"""

@current
Scenario: Try to expose two packs
Given file ./Oyafile containing
"""
Expand Down
1 change: 0 additions & 1 deletion features/tasks.feature
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ Scenario: Subdirectories are not recursed by default
"""

@current
Scenario: Subdirectories can be recursed
Given file ./Oyafile containing
"""
Expand Down
4 changes: 2 additions & 2 deletions todo.org
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
- State "CANCELLED" from "TODO" [2019-01-25 Fri 10:34] \\
It's enough to have "install" task by convention in packs and then oya tasks will show it.
:END:
* TODO Experiment: exposing tasks
* DONE Experiment: exposing tasks
** DONE PoC
** DONE Flag for go import
** DONE Multiple packages?
Expand All @@ -72,7 +72,7 @@ Use Meta.OriginalTaskName
**** DONE Add to .feature
**** DONE Add to tasks_test.go

** TODO Transient exposure (package exposing another package)
** DONE Transient exposure (package exposing another package)
* TODO Vendoring is only partially implemented
** TODO Simplify oya get/vendor (based on Import statements) TBD
**** Just use Import
Expand Down

0 comments on commit 880adbf

Please sign in to comment.