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

Bdymowski/oya tasks without run #29

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
fix tests executions
  • Loading branch information
bart84ek committed Apr 1, 2019
commit 0b8cee914aba6c3d15b204f354a03f21aa19bfc3
2 changes: 0 additions & 2 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ func init() {
}

func addTasksCommands(workDir string, recurse, changeset bool) error {
fmt.Println("workDir:", workDir)
installDir, err := project.InstallDir()
if err != nil {
return err
Expand Down Expand Up @@ -112,7 +111,6 @@ func addTasksCommands(workDir string, recurse, changeset bool) error {
}
err = o.Tasks.ForEach(func(taskName task.Name, task task.Task, meta task.Meta) error {
if !taskName.IsBuiltIn() {
fmt.Println(taskName)
rootCmd.AddCommand(createCmd(taskName, meta.Doc))
}
return nil
Expand Down
14 changes: 7 additions & 7 deletions features/builtins.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Scenario: Access Oyafile base directory
all: |
echo ${Oya[BasePath]}
"""
When I run "oya run --recurse all"
When I run "oya --recurse all"
Then the command succeeds
And the command outputs to stdout text matching
"""
Expand All @@ -37,7 +37,7 @@ Scenario: Access pack base directory
all: |
echo ${Oya[BasePath]}
"""
When I run "oya run foo.all"
When I run "oya foo.all"
Then the command succeeds
And the command outputs to stdout text matching
"""
Expand All @@ -53,7 +53,7 @@ Scenario: Access Oyafile Project name
all: |
echo ${Oya[Project]}
"""
When I run "oya run all"
When I run "oya all"
Then the command succeeds
And the command outputs to stdout text matching
"""
Expand All @@ -71,7 +71,7 @@ Scenario: Access Oyafile Project name in nested dir
all: |
echo ${Oya[Project]}
"""
When I run "oya run --recurse all"
When I run "oya --recurse all"
Then the command succeeds
And the command outputs to stdout text matching
"""
Expand All @@ -95,7 +95,7 @@ Scenario: Access Oyafile Project name inside pack
all: |
echo ${Oya[Project]}
"""
When I run "oya run foo.all"
When I run "oya foo.all"
Then the command succeeds
And the command outputs to stdout text matching
"""
Expand All @@ -121,7 +121,7 @@ Scenario: Use plush helpers when rendering
"""
<%= Len("box") %>
"""
When I run "oya run foo"
When I run "oya foo"
Then the command succeeds
And file ./template.txt contains
"""
Expand All @@ -146,7 +146,7 @@ Scenario: Use sprig functions when rendering (http:https://masterminds.github.io/sprig
"""
<%= Upper(Join(", ", arr)) %>
"""
When I run "oya run foo bar baz qux"
When I run "oya foo bar baz qux"
Then the command succeeds
And file ./template.txt contains
"""
Expand Down
8 changes: 4 additions & 4 deletions features/changeset.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Scenario: No changes
all: |
echo "Project1"
"""
When I run "oya run --changeset --recurse all"
When I run "oya --changeset --recurse all"
Then the command succeeds
And the command outputs to stdout
"""
Expand All @@ -37,7 +37,7 @@ Scenario: Child marks itself as changed
all: |
echo "Root"
"""
When I run "oya run --changeset --recurse all"
When I run "oya --changeset --recurse all"
Then the command succeeds
And the command outputs to stdout
"""
Expand All @@ -59,7 +59,7 @@ Scenario: Child marks parent as changed
all: |
echo "Root"
"""
When I run "oya run --changeset --recurse all"
When I run "oya --changeset --recurse all"
Then the command succeeds
And the command outputs to stdout
"""
Expand All @@ -81,7 +81,7 @@ Scenario: Parent marks child as changed
all: |
echo "Project1"
"""
When I run "oya run --changeset --recurse all"
When I run "oya --changeset --recurse all"
Then the command succeeds
And the command outputs to stdout
"""
Expand Down
4 changes: 2 additions & 2 deletions features/development.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Scenario: Use a local require

version: echo 1.0.0
"""
When I run "oya run foo.version"
When I run "oya foo.version"
Then the command succeeds
And the command outputs to stdout
"""
Expand Down Expand Up @@ -53,5 +53,5 @@ Scenario: With local require oya doesn't attempt to lookup requirements remotely

version: echo 1.0.0
"""
When I run "oya run foo.version"
When I run "oya foo.version"
Then the command succeeds
2 changes: 1 addition & 1 deletion features/flags.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Scenario: Pass flags and positional arguments to a task
echo --value = ${Oya[Flags.value]}
echo --other-switch = ${Oya[Flags.otherSwitch]}
"""
When I run "oya run task --switch positional1 --value=5 positional2 --other-switch"
When I run "oya task --switch positional1 --value=5 positional2 --other-switch"
Then the command succeeds
And the command outputs to stdout
"""
Expand Down
10 changes: 5 additions & 5 deletions features/get.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Scenario: Get a pack
"""
Project: project
"""
When I run "oya get github.com/tooploox/[email protected]"
When I run "oya Oya.get github.com/tooploox/[email protected]"
Then the command succeeds
And file ./.oya/packs/github.com/tooploox/[email protected]/Oyafile exists

Expand All @@ -20,7 +20,7 @@ Scenario: Get a pack with invalid import
Import:
invalidPack: foo.com/fooba/fooba
"""
When I run "oya get github.com/tooploox/[email protected]"
When I run "oya Oya.get github.com/tooploox/[email protected]"
Then the command succeeds
And file ./.oya/packs/github.com/tooploox/[email protected]/Oyafile exists

Expand All @@ -46,15 +46,15 @@ Scenario: Get two versions of the same pack
fixtures: github.com/tooploox/oya-fixtures
"""
When I'm in the ./project1 dir
And I run "oya run --recurse fixtures.version"
And I run "oya --recurse fixtures.version"
Then the command succeeds
And the command outputs to stdout
"""
1.0.0

"""
When I'm in the ../project2 dir
And I run "oya run fixtures.version"
And I run "oya fixtures.version"
Then the command succeeds
And the command outputs to stdout
"""
Expand All @@ -68,6 +68,6 @@ Scenario: Get a pack from a private repo
"""
Project: project
"""
When I run "oya get github.com/bilus/[email protected]"
When I run "oya Oya.get github.com/bilus/[email protected]"
Then the command succeeds
And file ./.oya/packs/github.com/bilus/[email protected]/Oyafile exists
2 changes: 1 addition & 1 deletion features/home.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ Scenario: Decide where installed packs are stored
Project: project
"""
And the OYA_HOME environment variable set to "/tmp/oya_home"
When I run "oya get github.com/tooploox/[email protected]"
When I run "oya Oya.get github.com/tooploox/[email protected]"
Then the command succeeds
And file /tmp/oya_home/.oya/packs/github.com/tooploox/[email protected]/Oyafile exists
6 changes: 3 additions & 3 deletions features/ignore.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Scenario: Empty .oyaignore
"""
all: echo "subdir"
"""
When I run "oya run --recurse all"
When I run "oya --recurse all"
Then the command succeeds
And the command outputs to stdout
"""
Expand All @@ -34,7 +34,7 @@ Scenario: Ignore file
"""
all: echo "subdir"
"""
When I run "oya run --recurse all"
When I run "oya --recurse all"
Then the command succeeds
And the command outputs to stdout
"""
Expand All @@ -58,7 +58,7 @@ Scenario: Wildcard ignore
"""
all: echo "subdir/foo"
"""
When I run "oya run --recurse all"
When I run "oya --recurse all"
Then the command succeeds
And the command outputs to stdout
"""
Expand Down
16 changes: 11 additions & 5 deletions features/import.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Scenario: Import a pack
"""
Project: project
"""
When I run "oya import github.com/bilus/oya"
When I run "oya Oya.import github.com/bilus/oya"
Then the command succeeds
And file ./Oyafile contains
"""
Expand All @@ -22,17 +22,23 @@ Scenario: Import a pack to other already imported
Given file ./Oyafile containing
"""
Project: project
Require:
github.com/tooploox/oya/other: v0.0.2

Import:
other: github.com/tooploox/oya/other

task: |
echo "check"
"""
When I run "oya import github.com/tooploox/oya/next"
When I run "oya Oya.import github.com/tooploox/oya/next"
Then the command succeeds
And file ./Oyafile contains
"""
Project: project
Require:
github.com/tooploox/oya/other: v0.0.2

Import:
next: github.com/tooploox/oya/next
other: github.com/tooploox/oya/other
Expand All @@ -51,7 +57,7 @@ Scenario: Import a pack to empty Oyafile
"""
"""
When I'm in the ./subdir dir
And I run "oya import github.com/tooploox/oya/next"
And I run "oya Oya.import github.com/tooploox/oya/next"
Then the command succeeds
And file ./subdir/Oyafile contains
"""
Expand All @@ -68,7 +74,7 @@ Scenario: Import a pack to Oyafile with other things
task: |
echo "check"
"""
When I run "oya import github.com/bilus/oya"
When I run "oya Oya.import github.com/bilus/oya"
Then the command succeeds
And file ./Oyafile contains
"""
Expand All @@ -91,7 +97,7 @@ Scenario: Import a pack which is already imported
task: |
echo "check"
"""
When I run "oya import github.com/bilus/oya"
When I run "oya Oya.import github.com/bilus/oya"
Then the command fails with error matching
"""
.*Pack already imported: github.com/bilus/oya.*
Expand Down
18 changes: 9 additions & 9 deletions features/imports.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Scenario: Import tasks from installed packs
touch OK
echo "Done"
"""
When I run "oya run foo.all"
When I run "oya foo.all"
Then the command succeeds
And the command outputs to stdout
"""
Expand Down Expand Up @@ -48,7 +48,7 @@ Scenario: Import task using pack values
bar="${Oya[foo]}"
echo $bar
"""
When I run "oya run foo.all"
When I run "oya foo.all"
Then the command succeeds
And the command outputs to stdout
"""
Expand All @@ -75,7 +75,7 @@ Scenario: Import task using BasePath
bar=$(basename ${Oya[BasePath]})
echo $bar
"""
When I run "oya run foo.all"
When I run "oya foo.all"
Then the command succeeds
And the command outputs to stdout
"""
Expand All @@ -101,7 +101,7 @@ Scenario: Access pack values
Values:
bar: xxx
"""
When I run "oya run all"
When I run "oya all"
Then the command succeeds
And the command outputs to stdout
"""
Expand Down Expand Up @@ -133,7 +133,7 @@ Scenario: Access current project values
echo ${Oya[p1.foo]}
echo ${Oya[foo]}
"""
When I run "oya run --recurse all"
When I run "oya --recurse all"
Then the command succeeds
And the command outputs to stdout
"""
Expand Down Expand Up @@ -163,7 +163,7 @@ Scenario: Pack values can be set from project Oyafile prefixed with pack alias
all: |
echo ${Oya[fruit]}
"""
When I run "oya run foo.all"
When I run "oya foo.all"
Then the command succeeds
And the command outputs to stdout
"""
Expand Down Expand Up @@ -196,7 +196,7 @@ Scenario: Pack values are overriden in main Oyafile
echo ${Oya[fruit]}
echo ${Oya[wege]}
"""
When I run "oya run foo.all"
When I run "oya foo.all"
Then the command succeeds
And the command outputs to stdout
"""
Expand Down Expand Up @@ -226,7 +226,7 @@ Scenario: Import tasks in a subdir Oyafile
echo "all"
"""
And I'm in the ./subdir dir
When I run "oya run --recurse foo.all"
When I run "oya --recurse foo.all"
Then the command succeeds
And the command outputs to stdout
"""
Expand All @@ -253,7 +253,7 @@ Scenario: Import tasks from a subdirectory
project1: /project1
"""
And I'm in the ./project2 dir
When I run "oya run project1.echo"
When I run "oya project1.echo"
Then the command succeeds
And the command outputs to stdout
"""
Expand Down
6 changes: 3 additions & 3 deletions features/init.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Background:
Given I'm in project dir

Scenario: Init a project
When I run "oya init"
When I run "oya Oya.init"
Then the command succeeds
And file ./Oyafile exists

Scenario: Init a existing project
When I run "oya init"
And I run "oya init"
When I run "oya Oya.init"
And I run "oya Oya.init"
Then the command fails with error matching
"""
.*already an Oya project.*
Expand Down
Loading