| Age | Commit message (Collapse) | Author |
|
These relied on the previous behaviour of `#post_resource` handling
uploads. This is no longer the case. Instead, you have to call
`HTTPService.upload` manually and pass the result to `#post_resource`
via the `params` argument (like in `WorkbenchImportWorker#params`).
|
|
The `ReferentialMetadataKludge` expects a couple of `Chouette::Line`s to
already exist in the database in order to successfully create a
`ReferentialMetadata` record.
In tests, this is not the case. As a kludge to the kludge, create the
expected line records in the tests that fail because of it, with the
proviso that these additions should be removed or changed once we have
real `ReferentialMetadata` handling for imports.
|
|
These tests were failing:
1) NetexImport POST netex_imports with correct credentials and incorrect request behaves like illegal attributes missing file does not succeed
Failure/Error: expect( json_response_body['errors'][bad_attribute.to_s] ).not_to be_empty
TypeError:
no implicit conversion of String into Integer
Shared Example Group: "illegal attributes" called from ./spec/requests/api/v1/netex_import_spec.rb:90
# ./spec/requests/api/v1/netex_import_spec.rb:77:in `[]'
# ./spec/requests/api/v1/netex_import_spec.rb:77:in `block (6 levels) in <top (required)>'
# -e:1:in `<main>'
2) NetexImport POST netex_imports with correct credentials and incorrect request name already taken behaves like illegal attributes missing name does not succeed
Failure/Error: expect( json_response_body['errors'][bad_attribute.to_s] ).not_to be_empty
TypeError:
no implicit conversion of String into Integer
Shared Example Group: "illegal attributes" called from ./spec/requests/api/v1/netex_import_spec.rb:96
# ./spec/requests/api/v1/netex_import_spec.rb:77:in `[]'
# ./spec/requests/api/v1/netex_import_spec.rb:77:in `block (6 levels) in <top (required)>'
# -e:1:in `<main>'
The problem was caused by the fact that the error messages come back
from `ErrorFormat` as an array of hashes, which contain a single key
corresponding to the invalid field.
Instead, the error messages should be returned as a single hash with a
bunch of keys corresponding to the invalid fields.
This change gets the above tests to pass.
|
|
While `ReferentialMetadataKludge` exists, the name needs to match one of
the keys in `#name_to_periods`, otherwise all the tests that use these
attributes fail.
|
|
|
|
|
|
Speed up these tests by using `build_stubbed` for factories where
possible.
|
|
|
|
These tests broke because the ZipService changed. Since they seem to
require a lot of modifications or rewrites in order to get them back in
working order, skip them for now until I can revisit them next week.
|
|
|
|
This one doesn't do anything. The real one currently lives in
`app/models/concerns/error_format.rb` (it shouldn't live there according
to Robert, but for now that's the story).
|
|
Now that the code has been changed to use `#update`, update these test
mocks to bind to the right method.
|
|
The `RetryService` is not used any more, so this code that uses it
should be removed.
|
|
This is no longer being used as the `WorkbenchImportWorker` was
refactored and it was decided that we don't want to enable retries for
imports.
For example, imagine you have an hour-long import that fails after 50
minutes. We retry three times and now we've wasted 2.5 hours of your
time just to tell you that the import failed.
Thus the decision was to remove it.
|
|
Previously, the OFFRE_... zip's two referentials had overlapping dates
(2017-03-01..2017-03-31 & 2017-03-01..2017-12-31).
This caused this validation error when trying to save the referentials:
OFFRE_TRANSDEV_20170301122517 couvre le même périmètre d'offre
To fix this, Alban & I changed the dates of the two offers inside the
zip (in the calendrier.xml files) and matched the dates in
`ReferentialMetadataKludge`.
|
|
While testing imports with Alban, we saw that this request was blocking,
not asynchronous. The Java application apparently didn't figure that it
should close HTTP connections before handling a long-running import job.
In order to get around that on the Rails appliation side, Alban
suggested putting the request in a thread. Works like a charm, and we
respond in a sensible amount of time.
|
|
Instead of hard-coding an ID for the line IDs, get them by their
`objectid` field.
Worked on this with Alban.
Even though the Kludge class is for testing purposes only and isn't
meant to be real, let's take out the hard-coded values.
The `objectid`s correspond to those in the OFFRE_... zip in
`spec/fixtures/`.
|
|
This param isn't permitted by the controller and we're currently not
using it for anything. It produces a warning message in the logs, so I
figured we should remove it. We may want to change the architecture to
create referentials outside of the API, and thus would have to add this
param in, but until then it's not needed.
|
|
|
|
display ... errors
|
|
|
|
imports#show
|
|
|
|
Refs #4280
|
|
|
|
Refs #4280
|
|
|
|
Retry removed (but not the deadcode yet) [amend me]
|
|
|
|
|
|
organisation code
|
|
|
|
|
|
|
|
|
|
|
|
Debugging Java Integration (ZipService -> HTTPService -> Object Creation)
- Created an ErrorFormat concern to see what went wrong in the HTTP call
as so many things can go wrong due to:
* Timeout Issues
* Illegal database setup or cleaning before tests
|
|
|
|
This reverts commit 30b746b8b238c9ba22e972556e94950adb3f5e8b.
|
|
`Chouette::Route#duplicate`
|
|
|
|
- Replzed Lazy Enum over get_next_entry and group by with explicit looping and yielding to an instance level enumerator
that yields streams per subdir (wich represents a referential).
- Fixtures and Specs that use a REAL usecase.
Next: Get rid of metadata kludge (should fix failing specs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|