datamodel-code-generator icon indicating copy to clipboard operation
datamodel-code-generator copied to clipboard

🚑 fixes graphql parser --use-standard-collections --use-union-operator --use-annotated

Open bpsoos opened this issue 1 year ago • 3 comments

resolves #1941

bpsoos avatar Jun 27 '24 01:06 bpsoos

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (202c0b8) to head (7a33cd8).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2016   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           38        38           
  Lines         4197      4199    +2     
  Branches       967       967           
=========================================
+ Hits          4197      4199    +2     
Flag Coverage Δ
unittests 99.66% <100.00%> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 28 '24 10:06 codecov[bot]

CodSpeed Performance Report

Merging #2016 will create unknown performance changes

Comparing bpsoos:fix/1941-graphql-options (7a33cd8) with main (202c0b8)

Summary

🆕 29 new benchmarks ⁉️ 29 dropped benchmarks

:warning: Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main bpsoos:fix/1941-graphql-options Change
🆕 test_main_all_of_ref N/A 52.2 ms N/A
🆕 test_main_autodetect N/A 72.4 ms N/A
🆕 test_main_external_definitions N/A 55.9 ms N/A
🆕 test_main_inheritance_forward_ref N/A 138 ms N/A
🆕 test_main_inheritance_forward_ref_keep_model_order N/A 139.4 ms N/A
🆕 test_main_json_reuse_enum_default_member N/A 99.2 ms N/A
🆕 test_main_jsonschema_complex_any_of N/A 71.5 ms N/A
🆕 test_main_jsonschema_external_files N/A 53.1 ms N/A
🆕 test_main_jsonschema_field_include_all_keys N/A 71.2 ms N/A
🆕 test_main_jsonschema_id N/A 59.7 ms N/A
🆕 test_main_jsonschema_multiple_files N/A 96 ms N/A
🆕 test_main_jsonschema_nested_deep N/A 87.6 ms N/A
🆕 test_main_jsonschema_special_field_name N/A 73.9 ms N/A
🆕 test_main_nested_directory N/A 279.1 ms N/A
🆕 test_main_root_id_jsonschema_self_refs_with_local_file N/A 100.1 ms N/A
🆕 test_main_root_id_jsonschema_self_refs_with_remote_file N/A 99.5 ms N/A
🆕 test_main_strict_types N/A 93.4 ms N/A
🆕 test_main_strict_types_all_with_field_constraints N/A 88.3 ms N/A
🆕 test_force_optional N/A 161.5 ms N/A
🆕 test_main N/A 148.6 ms N/A
... ... ... ... ...

:information_source: Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

codspeed-hq[bot] avatar Jun 28 '24 10:06 codspeed-hq[bot]

Hello @koxudaxi,

Sorry for the large diff. Most of it is just refactor. The actual fix is contained in these commits.

The rest of the changes included (only refactor of tests/test data):

  • separated test_main.py into independent test files (test_main_openapi.py, test_main_jsonschema.py, etc.)
  • grouped the expectations in tests/data/expectation/main into groups (openapi, jsonschema, json, etc.)
  • updated the tests to use the path of the grouped expectations

My aim here was to reduce directory sizes and LoC/file, in order to improve maintainability.

Let me know what you think!

bpsoos avatar Jun 28 '24 15:06 bpsoos

@bpsoos Thanks for the great PR. Sorry, the test coverage was broken, but I have fixed it. The PR has quite a few conflicts. Can you please fix them?

koxudaxi avatar Jul 01 '24 16:07 koxudaxi

@koxudaxi I think I have fixed all of the conflicts

bpsoos avatar Jul 01 '24 19:07 bpsoos