diff --git a/.github/docker/application.yml b/.github/docker/application.yml index 33bc581..4d834e3 100644 --- a/.github/docker/application.yml +++ b/.github/docker/application.yml @@ -1,4 +1,8 @@ kestra: + security: + super-admin: + username: root@root.com + password: Root!1234 encryption: secret-key: LWBErwwlb/BQcxWujsm+/scPeO01cTKzvW44GbAWvII= kafka: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c6c06b1..9504ee6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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/ diff --git a/internal/provider/resource_dashboard_test.go b/internal/provider/resource_dashboard_test.go index caad8c8..2dd8b59 100644 --- a/internal/provider/resource_dashboard_test.go +++ b/internal/provider/resource_dashboard_test.go @@ -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) }