Skip to content

Commit

Permalink
Migrated mod load test from flowpipe repo to pipe-fittings repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
vhadianto committed Oct 25, 2023
1 parent 715953e commit 0a4f7ec
Show file tree
Hide file tree
Showing 30 changed files with 1,252 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modconfig/flowpipe_pipeline_step.go
Original file line number Diff line number Diff line change
Expand Up @@ -2907,7 +2907,9 @@ func (p *PipelineStepInput) Validate() hcl.Diagnostics {
}
}

if p.Notify != nil {
// Only validate the notify block if there are no unresolved bodies
// TODO: this is not correct fix this
if p.Notify != nil && p.UnresolvedBodies[schema.BlockTypeNotify] == nil {
moreDiags := p.Notify.Validate()
if len(moreDiags) > 0 {
diags = append(diags, moreDiags...)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
mod "mod_child_a" {
title = "Child Mod A"
}

pipeline "this_pipeline_is_in_the_child" {
step "echo" "foo" {
text = "foo"
}

output "foo_a" {
value = step.echo.foo.text
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
mod "mod_child_b" {
title = "Child Mod b"
}

pipeline "this_pipeline_is_in_the_child" {
step "echo" "foo" {
text = "foo"
}

output "foo_b" {
value = step.echo.foo.text
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pipeline "another_child_pipeline" {
step "echo" "foo" {
text = "foo"
}

output "foo_b" {
value = step.echo.foo.text
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pipeline "second_pipe_in_the_child" {
step "echo" "foo" {
text = "foo"
}

output "foo_b" {
value = step.echo.foo.text
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pipeline "nested_pipe_in_child_hcl" {
step "echo" "foo" {
text = "foo"
}

output "foo_b" {
value = step.echo.foo.text
}
}
18 changes: 18 additions & 0 deletions tests/flowpipe_mod_tests/backward_compatible_mod/.mod.cache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"mod_parent": {
"mod_child_a": {
"name": "mod_child_a",
"alias": "mod_child_a",
"version": "1.0.0",
"constraint": "*",
"struct_version": 20220411
},
"mod_child_b": {
"name": "mod_child_b",
"alias": "mod_child_b",
"version": "2.0.0",
"constraint": "*",
"struct_version": 20220411
}
}
}
32 changes: 32 additions & 0 deletions tests/flowpipe_mod_tests/backward_compatible_mod/mod.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
mod "mod_parent" {
title = "Parent Mod"
require {
mod "mod_child_a" {
version = "1.0.0"
}
mod "mod_child_b" {
version = "2.0.0"
}
}
}

pipeline "json" {
step "echo" "json" {
json = jsonencode({
Version = "2012-10-17"
Statement = [
{
Action = [
"ec2:Describe*",
]
Effect = "Allow"
Resource = "*"
},
]
})
}

output "foo" {
value = step.echo.json.json
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pipeline "parent_pipeline_hcl_nested" {
step "echo" "foo" {
text = "foo"
}

output "foo_b" {
value = step.echo.foo.text
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pipeline "parent_pipeline_sp_nested" {
step "echo" "foo" {
text = "foo"
}

output "foo_b" {
value = step.echo.foo.text
}
}
20 changes: 20 additions & 0 deletions tests/flowpipe_mod_tests/backward_compatible_mod/pipes.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
pipeline "parent_pipeline_hcl" {
step "echo" "foo" {
text = "foo"
}

output "foo_b" {
value = step.echo.foo.text
}
}


pipeline "parent_pipeline_hcl_b" {
step "echo" "foo" {
text = "foo"
}

output "foo_b" {
value = step.echo.foo.text
}
}
10 changes: 10 additions & 0 deletions tests/flowpipe_mod_tests/backward_compatible_mod/pipes.sp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pipeline "parent_pipeline_sp" {
step "echo" "foo" {
text = "foo"
}

output "foo_b" {
value = step.echo.foo.text
}
}

Loading

0 comments on commit 0a4f7ec

Please sign in to comment.