meshkit icon indicating copy to clipboard operation
meshkit copied to clipboard

Golang Test Validator Errors

Open willcalcote opened this issue 1 year ago • 6 comments

Description Running make test produces the following errors:

--- FAIL: TestValidator (0.01s)
    validate_test.go:70: unknown domain for reference "../core.json#/definitions/uuid" (and 4 more errors)
    validate_test.go:70: unknown domain for reference "../core.json#/definitions/uuid" (and 4 more errors)
    validate_test.go:80: test failed for catalog_data, got true, want true error: <nil>
    validate_test.go:70: unknown domain for reference "../core.json#/definitions/uuid" (and 4 more errors)
    validate_test.go:80: test failed for models, got true, want true error: <nil>

Expected Behavior All tests passing.

willcalcote avatar Aug 21 '24 18:08 willcalcote

@willcalcote, I think the error is coming because the schema for path design, catalog_data, and models is nil

ShivanshuGupta07 avatar Aug 25 '24 01:08 ShivanshuGupta07

@TomiwaAribisala-git , If there was an error in the loadSchema() function, then why the log message "error in loadSchema" is not appearing?

ShivanshuGupta07 avatar Aug 25 '24 15:08 ShivanshuGupta07

On tracking back the error, I got to know that jsonschema.Extract() written inside 'func JsonSchemaToCue(value string)(){}' of cue.go is producing error which is Error during jsonschema.Extract: unknown domain for reference "../core.json#/definitions/uuid" (and 4 more errors)

ShivanshuGupta07 avatar Aug 25 '24 15:08 ShivanshuGupta07

@willcalcote It seems that core.json is expected at ../core.json, but the file is not present in the repository.

mainali123 avatar Oct 31 '24 02:10 mainali123

@willcalcote is this issue still accepting PRs ?

TusharMohapatra07 avatar Dec 27 '24 17:12 TusharMohapatra07

@willcalcote It seems that core.json is expected at ../core.json, but the file is not present in the repository.

This dir image if of imported library - github.com/meshery/schemas/constructs/v1beta1 Image

core.json is at 2 dir's above design.json but the error is still there

--- FAIL: TestValidator (0.01s)
    validate_test.go:69: unknown domain for reference "../../core.json" (and 5 more errors)
    validate_test.go:69: unknown domain for reference "../../core.json" (and 5 more errors)
    validate_test.go:77: test failed for catalog_data, got true, want true error: <nil>
    validate_test.go:69: unknown domain for reference "../../core.json" (and 5 more errors)
    validate_test.go:77: test failed for models, got true, want true error: <nil>
FAIL
FAIL    github.com/layer5io/meshkit/validator   0.902s
FAIL

Exar04 avatar Apr 05 '25 11:04 Exar04