From c9526000092695cb2c6fbf3ff8329e58ad2cd551 Mon Sep 17 00:00:00 2001 From: Marcin Bilski Date: Mon, 1 Nov 2021 01:29:00 +0100 Subject: [PATCH] Add a test, clean up. --- features/expose.feature | 103 +++++++++++++++++++++++++++++++++++++++- features/import.feature | 2 - features/tasks.feature | 1 - 3 files changed, 101 insertions(+), 5 deletions(-) diff --git a/features/expose.feature b/features/expose.feature index bfeaae64..efc0b14f 100644 --- a/features/expose.feature +++ b/features/expose.feature @@ -33,7 +33,6 @@ Scenario: Expose tasks """ -@current Scenario: Never overwrite existing an task when exposing tasks Given file ./Oyafile containing """ @@ -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 """ @@ -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 + + """ diff --git a/features/import.feature b/features/import.feature index 0535816b..c597ed46 100644 --- a/features/import.feature +++ b/features/import.feature @@ -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 """ @@ -158,7 +157,6 @@ Scenario: Import a pack and expose it """ -@current Scenario: Try to expose two packs Given file ./Oyafile containing """ diff --git a/features/tasks.feature b/features/tasks.feature index 0ddd90e6..5052c10a 100644 --- a/features/tasks.feature +++ b/features/tasks.feature @@ -57,7 +57,6 @@ Scenario: Subdirectories are not recursed by default """ -@current Scenario: Subdirectories can be recursed Given file ./Oyafile containing """