Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 214
Report all empty resources present in error diagnostic#1685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
21e158a3592de99c1f33b52bec40d440440242c6eee4644abFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| bundle: | ||
| name: undefined-job | ||
| resources: | ||
| jobs: | ||
| undefined-job: | ||
| test: | ||
| name: "Test Job" | ||
| experiments: | ||
| undefined-experiment: | ||
| pipelines: | ||
| undefined-pipeline: |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| package config_tests | ||
| import ( | ||
| "context" | ||
| "path/filepath" | ||
| "testing" | ||
| "github.com/databricks/cli/bundle" | ||
| "github.com/databricks/cli/bundle/config/validate" | ||
| "github.com/databricks/cli/libs/diag" | ||
| "github.com/databricks/cli/libs/dyn" | ||
| "github.com/stretchr/testify/assert" | ||
| ) | ||
| func TestUndefinedResourcesLoadWithError(t *testing.T) { | ||
| b := load(t, "./undefined_resources") | ||
| diags := bundle.Apply(context.Background(), b, validate.AllResourcesHaveValues()) | ||
| assert.Len(t, diags, 3) | ||
| assert.Contains(t, diags, diag.Diagnostic{ | ||
| Severity: diag.Error, | ||
| Summary: "job undefined-job is not defined", | ||
| Locations: []dyn.Location{{ | ||
| File: filepath.FromSlash("undefined_resources/databricks.yml"), | ||
| Line: 6, | ||
| Column: 19, | ||
| }}, | ||
| Paths: []dyn.Path{dyn.MustPathFromString("resources.jobs.undefined-job")}, | ||
| }) | ||
| assert.Contains(t, diags, diag.Diagnostic{ | ||
| Severity: diag.Error, | ||
| Summary: "experiment undefined-experiment is not defined", | ||
| Locations: []dyn.Location{{ | ||
| File: filepath.FromSlash("undefined_resources/databricks.yml"), | ||
| Line: 11, | ||
| Column: 26, | ||
| }}, | ||
| Paths: []dyn.Path{dyn.MustPathFromString("resources.experiments.undefined-experiment")}, | ||
| }) | ||
| assert.Contains(t, diags, diag.Diagnostic{ | ||
| Severity: diag.Error, | ||
| Summary: "pipeline undefined-pipeline is not defined", | ||
| Locations: []dyn.Location{{ | ||
| File: filepath.FromSlash("undefined_resources/databricks.yml"), | ||
| Line: 14, | ||
| Column: 24, | ||
| }}, | ||
| Paths: []dyn.Path{dyn.MustPathFromString("resources.pipelines.undefined-pipeline")}, | ||
| }) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline with @pietern. We are removing these assertions to keep the unit tests symmetric with the ones in
job_and_pipeline_test.go