-
Notifications
You must be signed in to change notification settings - Fork 45
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
add test that generated json from autoyast xml is valid #1946
base: master
Are you sure you want to change the base?
Conversation
…ilename is omitted it will be valid json and fix empty location tag(fix#1903)
6eabbcd
to
91bc0c3
Compare
cbd6b5d
to
ff6bc66
Compare
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.
Just some minor comments. Otherwise, LGTM.
@@ -100,10 +101,10 @@ def read_init_scripts | |||
# @param section [Hash] AutoYaST script section | |||
def read_script(section) | |||
script = { | |||
"name" => section["file_name"] | |||
"name" => section["filename"] || "annonymous#{@anonymous_counter += 1}" |
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.
typo: it should be anonymous
but, to be honest, I do not like that prefix that much. I would prefer script-
, or unnamed-
or something else.
context "for cloned profile" do | ||
let(:profile_name) { "cloned.xml" } | ||
|
||
it "generate json according to schema" do |
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.
it "generate json according to schema" do | |
it "generate JSON according to schema" do |
@@ -177,4 +178,29 @@ | |||
subject.to_agama(workdir) | |||
end | |||
end | |||
|
|||
context "for cloned profile" do |
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.
It is just an AutoYaST profile, right? No matter whether it is cloned or written from scratch.
Problem
autoinst.xml profile conversion can lead to non valid profile.json
#1960
#1907
#1903
Solution
Add ci test to validate cloned autoyast profile. Fix issue with localization. Fix other autoyast conversion related issues.
Note: sadly I need to add python3-jsonschema to install as rubygem-json-schema does not support anything newer then draft5 json schema and we use newer.
Testing
Output
before pretty generate
after pretty generate