-
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
Draft
jreidinger
wants to merge
6
commits into
master
Choose a base branch
from
ci_autoinst_schema
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,194
−22
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
369e6e2
add test that generated json from autoyast xml is valid
jreidinger dceb4b4
fix deprecation warning
jreidinger af430b4
fix name of localization section
jreidinger bc47b7f
add to test also scripts. Fix typo in filename, ensure that even if f…
jreidinger 91bc0c3
fix tests
jreidinger ff6bc66
fix also in tests file_name typo ( see official documentation at http…
jreidinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -40,8 +40,9 @@ | |||||
end | ||||||
let(:xml_valid?) { true } | ||||||
let(:xml_errors) { [] } | ||||||
let(:result_path) { File.join(workdir, "autoinst.json") } | ||||||
let(:result) do | ||||||
content = File.read(File.join(workdir, "autoinst.json")) | ||||||
content = File.read(result_path) | ||||||
JSON.parse(content) | ||||||
end | ||||||
let(:storage_manager) do | ||||||
|
@@ -109,7 +110,7 @@ | |||||
|
||||||
it "evaluates the ERB code" do | ||||||
subject.to_agama(workdir) | ||||||
expect(result["l10n"]).to include( | ||||||
expect(result["localization"]).to include( | ||||||
"languages" => ["en_US.UTF-8", "es_ES.UTF-8"] | ||||||
) | ||||||
end | ||||||
|
@@ -157,9 +158,9 @@ | |||||
end | ||||||
end | ||||||
|
||||||
it "exports l10n settings" do | ||||||
it "exports localization settings" do | ||||||
subject.to_agama(workdir) | ||||||
expect(result["l10n"]).to include( | ||||||
expect(result["localization"]).to include( | ||||||
"languages" => ["en_US.UTF-8"], | ||||||
"timezone" => "Atlantic/Canary", | ||||||
"keyboard" => "us" | ||||||
|
@@ -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 commentThe 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. |
||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
# sadly rubygem-json-schema cannot be used due to too old supported format | ||||||
if !system("which jsonschema") | ||||||
pending "can run only if python3-jsonschema is installed" | ||||||
break | ||||||
end | ||||||
|
||||||
subject.to_agama(workdir) | ||||||
|
||||||
schema = File.expand_path( | ||||||
"../../../../rust/agama-lib/share/profile.schema.json", | ||||||
__dir__ | ||||||
) | ||||||
|
||||||
# filter out deprecation warning as check-jsonschema is not packaged for TW yet | ||||||
result = `jsonschema -i '#{result_path}' '#{schema}' 2>&1 | \ | ||||||
grep -v 'DeprecationWarning' | \ | ||||||
grep -v 'from jsonschema.cli import main'` | ||||||
expect(result).to eq "" | ||||||
end | ||||||
end | ||||||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 preferscript-
, orunnamed-
or something else.