Skip to content

Commit

Permalink
Issue #39: Fix issue preventing the proper passing of input parameter…
Browse files Browse the repository at this point in the history
…s to dynamic fixtures
  • Loading branch information
jessesuen committed Aug 26, 2017
1 parent 8d6909a commit 15e9a10
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 3 deletions.
43 changes: 41 additions & 2 deletions .argo/test-yamls/fixtures-dynamic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fixtures:
- DYN_FIX_WITH_OUTPUTS:
template: test-dynamic-fixture-container-with-outputs
steps:
- WEB-CLIENT-INLINED:
- SLEEPER:
image: alpine:latest
command: [sh, -c]
args: ["sleep 60"]
Expand All @@ -106,4 +106,43 @@ resources:
outputs:
artifacts:
BIN-DIR:
path: /bin
path: /bin

---
type: workflow
version: 1
name: test-fixtures-dynamic-inputs
description: Workflow which supplies input parameters to dynamic fixtures
inputs:
parameters:
COMMIT:
default: "%%session.commit%%"
REPO:
default: "%%session.repo%%"
ECHO:
default: hello world
fixtures:
- DYN_FIX_WITH_INPUTS:
template: test-dynamic-fixture-container-with-inputs
steps:
- SLEEPER:
image: alpine:latest
command: [sh, -c]
args: ["sleep 60"]
resources:
cpu_cores: 0.05
mem_mib: 64

---
type: container
version: 1
name: test-dynamic-fixture-container-with-inputs
image: alpine:latest
command: [sh, -c]
args: ["echo %%inputs.parameters.ECHO%%; sleep 999999"]
resources:
cpu_cores: 0.05
mem_mib: 64
inputs:
parameters:
ECHO:
10 changes: 9 additions & 1 deletion saas/axops/src/applatix.io/axops/service/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,15 @@ func EmbedWorkflowTemplate(tmpl *template.WorkflowTemplate, ctx *template.Templa
Template: eCtrTmpl.(*EmbeddedContainerTemplate),
Service: &Service{},
}
cRef.Arguments = fixTmplRef.Arguments
if fixTmplRef.Arguments != nil {
cRef.Arguments = fixTmplRef.Arguments
} else {
cRef.Arguments = make(template.Arguments)
}
axErr = inferArgumentsToChild(tmpl, ctx.Templates[fixTmplRef.Template], cRef.Arguments)
if axErr != nil {
return nil, axErr
}
eTmpl.Fixtures[i][fixRefName] = &EmbeddedFixtureTemplateRef{
EmbeddedContainerTemplateRef: &cRef,
}
Expand Down

0 comments on commit 15e9a10

Please sign in to comment.