-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Render location.go
#25
Conversation
…t rid of camelCase function from template
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.
Looks nice!
I run the 'go run main.go' from the cmd/mktp directory and it failed. I assumed that we need to go to that directory to run the script, let's talk about it offline.
Also I run the tests (Windows+WSL2) and I got error ->
=== RUN TestCreateFullFilePath
--- PASS: TestCreateFullFilePath (0.00s)
=== RUN TestListOfTemplates
--- PASS: TestListOfTemplates (0.00s)
=== RUN TestParseTemplateForInterfaces
generator_test.go:67:
Error Trace: /c/repo/github.com/pan-os-codegen/pkg/generate/generator_test.go:67
Error: Not equal:
expected: "package address\n\ntype Specifier func(Entry) (any, error)\n\ntype Normalizer interface {\n Normalize() ([]Entry, error)\n}"
actual : "package address\r\n\r\ntype Specifier func(Entry) (any, error)\r\n\r\ntype Normalizer interface {\r\n Normalize() ([]Entry, error)\r\n}"
Diff:
--- Expected
+++ Actual
@@ -1,7 +1,7 @@
-package address
-
-type Specifier func(Entry) (any, error)
-
-type Normalizer interface {
- Normalize() ([]Entry, error)
+package address
+
+type Specifier func(Entry) (any, error)
+
+type Normalizer interface {
+ Normalize() ([]Entry, error)
}
Test: TestParseTemplateForInterfaces
--- FAIL: TestParseTemplateForInterfaces (0.00s)
FAIL
FAIL github.com/paloaltonetworks/pan-os-codegen/pkg/generate 0.009s
=== RUN TestConfig
--- PASS: TestConfig (0.00s)
=== RUN TestUnmarshallAddressSpecFile
--- PASS: TestUnmarshallAddressSpecFile (0.00s)
=== RUN TestMarshallAddressSpecFile
--- PASS: TestMarshallAddressSpecFile (0.00s)
=== RUN TestGetNormalizations
--- PASS: TestGetNormalizations (0.01s)
=== RUN TestSanity
--- PASS: TestSanity (0.00s)
=== RUN TestValidation
--- PASS: TestValidation (0.00s)
PASS
ok github.com/paloaltonetworks/pan-os-codegen/pkg/properties 0.012s
=== RUN TestAsEntryXpath
--- PASS: TestAsEntryXpath (0.00s)
=== RUN TestPackageName
--- PASS: TestPackageName (0.00s)
=== RUN TestLocationType
--- PASS: TestLocationType (0.00s)
=== RUN TestOmitEmpty
--- PASS: TestOmitEmpty (0.00s)
PASS
ok github.com/paloaltonetworks/pan-os-codegen/pkg/translate 0.004s
FAIL
It was under the WSL2(ubuntu), but it could be environmental issue
@pimielowski you need to run with config file as described https://github.com/PaloAltoNetworks/pan-os-codegen/blob/render-location/README.md:
|
Description
PR delivers logic to generate
location.go
.Motivation and Context
#24
How Has This Been Tested?
Automated tests are included into PR.
Types of changes
Checklist