jhthorsen / json-validator

:cop: Validate data against a JSON schema
https://metacpan.org/release/JSON-Validator
56 stars 57 forks source link

t/load-file.t failing on windows 10 #234

Closed rai-gaurav closed 3 years ago

rai-gaurav commented 3 years ago

Steps to reproduce the behavior

Testcase 'load-file.t' is failing while installing the module on windows. cpan install JSON::Validator

Expected behavior

Testcase should not fail and module should be installed properly.

Actual behavior

A snippet of the error -

t/jv-integer.t ......................... ok
t/jv-not.t ............................. ok
t/jv-number.t .......................... ok
t/jv-object.t .......................... ok
t/jv-oneof.t ........................... ok
t/jv-required.t ........................ ok
t/jv-string.t .......................... ok
t/load-data.t .......................... ok
t/load-file.t .......................... 1/?
#   Failed test 'schema id'
#   at t/load-file.t line 14.
#          got: 'file://c:/berrybrew/5.30.1_64/cpan/build/json-validator-4.10-1/t/spec/person.json'
#     expected: 'file://c:%5cberrybrew%5c5.30.1_64%5ccpan%5cbuild%5cjson-validator-4.10-1%5ct%5cspec%5cperson.json'

#   Failed test 'schema id again'
#   at t/load-file.t line 18.
#          got: 'file://c:/berrybrew/5.30.1_64/cpan/build/json-validator-4.10-1/t/spec/person.json'
#     expected: 'file://c:%5cberrybrew%5c5.30.1_64%5ccpan%5cbuild%5cjson-validator-4.10-1%5ct%5cspec%5cperson.json'
# Looks like you failed 2 tests of 8.
t/load-file.t .......................... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/8 subtests
t/load-from-app.t ...................... [2021-01-05 23:00:03.78238] [11748] [debug] [UlY72ZNM] GET "/spec"
[2021-01-05 23:00:03.78291] [11748] [debug] [UlY72ZNM] Routing to a callback
[2021-01-05 23:00:03.78613] [11748] [debug] [UlY72ZNM] 200 OK (0.00375s, 266.667/s)
t/load-from-app.t ...................... 1/? [2021-01-05 23:00:03.90186] [11748] [debug] [nNAw_ItI] GET "/spec"
[2021-01-05 23:00:03.90219] [11748] [debug] [nNAw_ItI] Routing to a callback
[2021-01-05 23:00:03.90331] [11748] [error] [nNAw_ItI] not cached at t/load-from-app.t line 11.

[2021-01-05 23:00:03.90642] [11748] [debug] [nNAw_ItI] Template "exception.development.html.ep" not found
[2021-01-05 23:00:03.90760] [11748] [debug] [nNAw_ItI] Template "exception.html.ep" not found
[2021-01-05 23:00:03.91176] [11748] [debug] [nNAw_ItI] Rendering template "mojo/debug.html.ep"
[2021-01-05 23:00:03.92266] [11748] [debug] Your secret passphrase needs to be changed
[2021-01-05 23:00:03.92515] [11748] [debug] [nNAw_ItI] 500 Internal Server Error (0.023275s, 42.965/s)
t/load-from-app.t ...................... ok
t/load-http.t .......................... skipped: TEST_ONLINE=1
t/load-json.t .......................... ok
t/load-yaml-pp.t ....................... skipped: YAML::PP not available
t/load-yaml.t .......................... ok
t/more-bundle.t ........................ ok
t/predictable-errors.t ................. ok
t/random-errors.t ...................... skipped: TEST_RANDOM_ITERATIONS=10000
t/recursive_data_protection.t .......... ok
t/ref.t ................................ ok
t/relative-ref.t ....................... ok
t/schema-as-attr.t ..................... ok
t/to-json.t ............................ ok
t/util-checksum-yaml-xs.t .............. ok
t/util.t ............................... ok
t/validate-draft07.t ................... ok
t/validate-id.t ........................ ok
t/validate-recursive.t ................. ok
t/validate-schema.t .................... ok

Test Summary Report
-------------------
t/formats.t                          (Wstat: 0 Tests: 26 Failed: 0)
  TODO passed:   12
t/jv-formats.t                       (Wstat: 0 Tests: 84 Failed: 0)
  TODO passed:   36, 47-49
t/jv-object.t                        (Wstat: 0 Tests: 49 Failed: 0)
  TODO passed:   9
t/load-file.t                        (Wstat: 512 Tests: 8 Failed: 2)
  Failed tests:  4, 7
  Non-zero exit status: 2
Files=64, Tests=999, 48 wallclock secs ( 0.33 usr +  0.20 sys =  0.53 CPU)
Result: FAIL
Failed 1/64 test programs. 2/999 subtests failed.
gmake: *** [Makefile:915: test_dynamic] Error 255
  JHTHORSEN/JSON-Validator-4.10.tar.gz
  C:\berrybrew\5.30.1_64\c\bin\gmake.exe test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports JHTHORSEN/JSON-Validator-4.10.tar.gz
Stopping: 'install' failed for 'JSON::Validator'.

As mentioned in the error, I checked cpan tester report - http://matrix.cpantesters.org/?dist=JSON-Validator%204.10;os=mswin32;perl=5.30.1;reports=1 Its failing because of similar issue.

jhthorsen commented 3 years ago

Could you help me out fixing this? I was wonder if you could edited t/load-file.t and the following lines somewhere after line 9:

diag explain {
  case_tolerant => File::Spec->case_tolerant,
  file => $file,
  id => $id,
  lc_spec => lc $spec,
  spec => $spec->to_string,
};

I think the information will help me figure this one out.

jhthorsen commented 3 years ago

Got github actions up and running on Windows now, so I got the requested information 👍