Skip to content

Commit

Permalink
chore(ci): update CI to use super admin kestra config
Browse files Browse the repository at this point in the history
  • Loading branch information
Skraye committed Dec 19, 2024
1 parent 6f69e3f commit 325c25d
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 55 deletions.
4 changes: 4 additions & 0 deletions .github/docker/application.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
kestra:
security:
super-admin:
username: [email protected]
password: Root!1234
encryption:
secret-key: LWBErwwlb/BQcxWujsm+/scPeO01cTKzvW44GbAWvII=
kafka:
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,20 @@ jobs:
curl "127.27.27.27:9200" > /dev/null
curl -X POST "127.27.27.27:8080/api/v1/users" > /dev/null
curl -u john@doe.com:pass -X POST -H 'Content-Type: application/json' -d '{"id":"unit_test","name":"Unit Test"}' "127.27.27.27:8080/api/v1/tenants" > /dev/null
curl -u root@root.com:Root!1234 -X POST -H 'Content-Type: application/json' -d '{"id":"unit_test","name":"Unit Test"}' "127.27.27.27:8080/api/v1/tenants" > /dev/null
curl -H "Content-Type: application/x-ndjson" -XPOST "127.27.27.27:9200/_bulk?pretty" --data-binary @.github/workflows/index.jsonl
sleep 3
curl -H "Content-Type: multipart/form-data" -u john@doe.com:pass -X POST -F fileContent=@internal/resources/flow.py "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/files?path=/flow.py"
curl -H "Content-Type: text/plain" -u john@doe.com:pass -X PUT -d '"stringValue"' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/string"
curl -H "Content-Type: text/plain" -u john@doe.com:pass -X PUT -d '1' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/int"
curl -H "Content-Type: text/plain" -u john@doe.com:pass -X PUT -d '1.5' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/double"
curl -H "Content-Type: text/plain" -u john@doe.com:pass -X PUT -d 'false' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/falseBoolean"
curl -H "Content-Type: text/plain" -u john@doe.com:pass -X PUT -d 'true' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/trueBoolean"
curl -H "Content-Type: text/plain" -u john@doe.com:pass -X PUT -d '2022-05-01T03:02:01Z' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/dateTime"
curl -H "Content-Type: text/plain" -u john@doe.com:pass -X PUT -d '2022-05-01' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/date"
curl -H "Content-Type: text/plain" -u john@doe.com:pass -X PUT -d 'P3DT3H2M1S' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/duration"
curl -H "Content-Type: application/json" -u john@doe.com:pass -X PUT -d '{"some":"value","in":"object"}' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/object"
curl -H "Content-Type: application/json" -u john@doe.com:pass -X PUT -d '[{"some":"value","in":"object"},{"yet":"another","array":"object"}]' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/array"
curl -H "Content-Type: multipart/form-data" -u root@root.com:Root!1234 -X POST -F fileContent=@internal/resources/flow.py "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/files?path=/flow.py"
curl -H "Content-Type: text/plain" -u root@root.com:Root!1234 -X PUT -d '"stringValue"' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/string"
curl -H "Content-Type: text/plain" -u root@root.com:Root!1234 -X PUT -d '1' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/int"
curl -H "Content-Type: text/plain" -u root@root.com:Root!1234 -X PUT -d '1.5' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/double"
curl -H "Content-Type: text/plain" -u root@root.com:Root!1234 -X PUT -d 'false' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/falseBoolean"
curl -H "Content-Type: text/plain" -u root@root.com:Root!1234 -X PUT -d 'true' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/trueBoolean"
curl -H "Content-Type: text/plain" -u root@root.com:Root!1234 -X PUT -d '2022-05-01T03:02:01Z' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/dateTime"
curl -H "Content-Type: text/plain" -u root@root.com:Root!1234 -X PUT -d '2022-05-01' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/date"
curl -H "Content-Type: text/plain" -u root@root.com:Root!1234 -X PUT -d 'P3DT3H2M1S' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/duration"
curl -H "Content-Type: application/json" -u root@root.com:Root!1234 -X PUT -d '{"some":"value","in":"object"}' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/object"
curl -H "Content-Type: application/json" -u root@root.com:Root!1234 -X PUT -d '[{"some":"value","in":"object"},{"yet":"another","array":"object"}]' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/array"
- name: Set up Go
Expand All @@ -108,8 +108,8 @@ jobs:
TF_ACC: "1"
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }}
KESTRA_URL: "http://127.27.27.27:8080"
KESTRA_USERNAME: john@doe.com
KESTRA_PASSWORD: pass
KESTRA_USERNAME: root@root.com
KESTRA_PASSWORD: Root!1234
run: |
go test -v -cover ./internal/provider/
Expand Down
26 changes: 13 additions & 13 deletions internal/provider/resource_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ func TestAccResourceApp(t *testing.T) {
func testAccResourceApp(resourceId string) string {
return fmt.Sprintf(
`
resource "kestra_flow" "new_flow" {
namespace = "company.team"
flow_id = "get_data"
resource "kestra_flow" "new_flow" {
namespace = "company.team"
flow_id = "get_data"
content = <<EOT
id: get_data
namespace: company.team
Expand All @@ -37,9 +37,9 @@ tasks:
type: io.kestra.plugin.core.log.Log
message: Hello World! 🚀
EOT
}
resource "kestra_app" "%s" {
source = <<-EOF
}
resource "kestra_app" "%s" {
source = <<-EOF
id: test_tf
type: io.kestra.plugin.ee.apps.Execution
displayName: New display name
Expand All @@ -49,12 +49,12 @@ access: PRIVATE
layout:
- on: OPEN
blocks:
- type: io.kestra.plugin.ee.apps.core.blocks.Markdown
content: |
## Request data
Select the dataset you want to download.
EOF
}`,
blocks:
- type: io.kestra.plugin.ee.apps.core.blocks.Markdown
content: |
## Request data
Select the dataset you want to download.
EOF
}`,
resourceId)
}
55 changes: 27 additions & 28 deletions internal/provider/resource_dashboard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,32 @@ func TestAccResourceDashboard(t *testing.T) {
func testAccResourceDashboard(resourceId string) string {
return fmt.Sprintf(
`
resource "kestra_dashboard" "%s" {
source_code = <<-EOF
title: Overview_test
charts:
- id: executions_timeseries
type: io.kestra.plugin.core.dashboard.chart.TimeSeries
chartOptions:
displayName: Executions
description: Executions duration and count per date
legend:
enabled: true
column: date
colorByColumn: state
data:
type: io.kestra.plugin.core.dashboard.data.Executions
columns:
date:
field: START_DATE
displayName: Date
state:
field: STATE
total:
displayName: Executions
agg: COUNT
graphStyle: BARS
EOF
}`,
resource "kestra_dashboard" "%s" {
source_code = <<-EOF
title: Overview_test
charts:
- id: executions_timeseries
type: io.kestra.plugin.core.dashboard.chart.TimeSeries
chartOptions:
displayName: Executions
description: Executions duration and count per date
legend:
enabled: true
column: date
colorByColumn: state
data:
type: io.kestra.plugin.core.dashboard.data.Executions
columns:
date:
field: START_DATE
displayName: Date
state:
field: STATE
total:
displayName: Executions
agg: COUNT
graphStyle: BARS
EOF
}`,
resourceId)
}

0 comments on commit 325c25d

Please sign in to comment.