Skip to content

Commit

Permalink
Introduced a JSON schema of a leapp report
Browse files Browse the repository at this point in the history
Generated by https://jsonschema.net and adjusted manually.

The patch contains 2 schema files:
- 1.0.0 that matches the version that foreman_leapp relies on
- 1.1.0 that has the stable report key.

Basic unit test coverage is presented in test_reporting.py - the
sample leapp-report.json from vagrant box is checked against json
schema v 1.0.0 and 1.1.0.

OAMG-4263

Co-Authored-By: Petr Stodůlka <[email protected]>
  • Loading branch information
fernflower and pirat89 committed Feb 4, 2021
1 parent d9ded67 commit f4ed32e
Show file tree
Hide file tree
Showing 8 changed files with 1,934 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packaging/leapp.spec
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ install -m 0755 -d %{buildroot}%{_mandir}/man1
install -m 0644 -p man/snactor.1 %{buildroot}%{_mandir}/man1/

%if !0%{?fedora}
install -m 0755 -d %{buildroot}%{_datadir}/leapp
install -m 0755 -d %{buildroot}%{_datadir}/leapp/report_schema
install -m 0644 -p report-schema-v110.json %{buildroot}%{_datadir}/leapp/report_schema/report-schema.json
install -m 0755 -d %{buildroot}%{_sharedstatedir}/leapp
install -m 0755 -d %{buildroot}%{_sysconfdir}/leapp
install -m 0755 -d %{buildroot}%{_sysconfdir}/leapp/repos.d
Expand Down Expand Up @@ -234,6 +237,9 @@ rm -f %{buildroot}/%{_bindir}/leapp
%{_bindir}/leapp
%dir %{_sharedstatedir}/leapp
%dir %{_localstatedir}/log/leapp
%dir %{_datadir}/leapp/
%dir %{_datadir}/leapp/report_schema/
%{_datadir}/leapp/report_schema
%{python2_sitelib}/leapp/cli
%endif

Expand Down
648 changes: 648 additions & 0 deletions report-schema-v100.json

Large diffs are not rendered by default.

664 changes: 664 additions & 0 deletions report-schema-v110.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
-r requirements.txt
-e .

jsonschema==3.2.0
mock
pyrsistent==0.16.1
pytest==3.6.4
pytest-flake8
pytest-cov==2.9.0
Expand Down
Loading

0 comments on commit f4ed32e

Please sign in to comment.