| Age | Commit message (Collapse) | Author |
|
|
|
referential outside of the transaction. Refs #6833
|
|
|
|
5006 wb import filter refs with foreign lines
|
|
Implementation of Filtering Out Referentials with foreign lines in `app/workers/workbench_import_worker.rb`
- Using ZipService with the set of allowed lines of the organisation
- Fixing Integration Specs of the worker
- Refactoring, Debugging and Rebasing
|
|
|
|
af83/4782-create-worker-for-compliance-check-copy--rb201710301748
4782 create worker for compliance check copy rb201710301748
|
|
|
|
|
|
param name
|
|
In the first test, we weren't stubbing the Java API call, so it would
get executed for real. Put the HTTP stub in a `before(:each)` call so
that it gets stubbed for every test here.
Additionally, reorganise the tests a bit to clean them up. Move the HTTP
stub to a `let` to allow it to be called in a couple different places.
Since the HTTP stub depends on the `check_set` double, move that to a
`let` too. And have the `ComplianceControlSetCopier` mock always return
`check_set`, now that the app code depends on that return value.
Refs #4782
|
|
Previously I had been passing the `ComplianceControlSet` ID to the Java
API. The API actually expects the ID of the `ComplianceCheckSet`.
In order to get this ID, have the `ComplianceControlSetCopier` return
the `ComplianceCheckSet` that it creates, and use that to pass the the
ID to the Java API.
Refs #4782
|
|
Call the Java API URL to launch a validation after having copied the
`ComplianceControlSet` into a `ComplianceCheckSet`.
Copied the format with error logging from
`NetexImport#launch_java_import`.
In the test, make the ID variables global by putting them in `let`s.
Add `config.iev_url` to the Rails `test` environment so that we can
access this from our tests.
TODO: I just realised I'm sending the wrong ID. I should be sending the
check set ID.
Refs #4782
|
|
A new worker that launches the work to copy a `ComplianceControlSet` to
a `ComplianceCheckSet`.
Currently only handles a single control set and referential pair.
Probably want to extend this to handle multiple lists of these objects.
Also need to add in a call to the Java API to validate the check.
Refs #4782
|
|
|
|
|
|
|
|
spurious directories
- Speced and implemented
Missing:
- Exact message parameters (change key from xxx, how to add names of spurious directories)
|
|
- Discussing Spec
- Speced and implemented the corrupt zipfile part
Next:
- Spec incorrect directory structure part
- Implement incorrect directory structure part
|
|
|
|
|
|
|
|
|
|
performs a real referential clone. Refs #4335
|
|
The import job now updates its `ended_at` time at the end of the import
job. The mock didn't know this, though, so it gave us an error at that
call. Add a new expectation for the update of the `ended_at` time to get
this test to pass again.
|
|
The code was changed in 038710b22ccf3dd2421ec8d07fae45ef05a47ada, but
the tests weren't changed to reflect this.
In that change, the subdir enumeration is stopped if the `HTTPService`
POST request fails with an error.
This caused us to receive the following error when running the tests:
2) WorkbenchImportWorker multireferential zipfile with error downloads a zip file, cuts it, and uploads some pieces
Failure/Error:
expect { worker.perform import.id }.to raise_error(
StopIteration,
post_response_failure.body
)
expected StopIteration with {:error=>"What was you thinking"}, got #<StopIteration: {:error=>"What was you thinking"}> with backtrace:
# ./app/workers/workbench_import_worker.rb:63:in `upload_entry_group'
# ./app/workers/workbench_import_worker.rb:38:in `each'
# ./app/workers/workbench_import_worker.rb:38:in `each_with_index'
# ./app/workers/workbench_import_worker.rb:38:in `upload'
# ./app/workers/workbench_import_worker.rb:15:in `perform'
# ./spec/workers/workbench_import_worker_spec.rb:105:in `block (4 levels) in <top (required)>'
# ./spec/workers/workbench_import_worker_spec.rb:105:in `block (3 levels) in <top (required)>'
# -e:1:in `<main>'
# ./spec/workers/workbench_import_worker_spec.rb:105:in `block (3 levels) in <top (required)>'
# -e:1:in `<main>'
In order to get around this, just catch the error. Hopefully this is
right.
|
|
Was getting this error as a result of the new parameters expected in
`mock_post`:
2) WorkbenchImportWorker multireferential zipfile with error downloads a zip file, cuts it, and uploads some pieces
Failure/Error:
HTTPService.post_resource(
host: export_host,
path: export_path,
params: params(eg_file, eg_name))
HTTPService received :post_resource with unexpected arguments
expected: ({:host=>"http://www.example.com", :path=>"/api/v1/netex_imports.json", :params=>{:netex_import=>{:par... @original_filename="subdir 0.zip", @local_path="local.path", @io=#<Double "subdir 0">, @opts={}>}}})
got: ({:host=>"http://www.example.com", :path=>"/api/v1/netex_imports.json", :params=>{:netex_import=>{:par.../stif-boiv/tmp/imports/WorkbenchImport_subdir 0_38821.zip>, @opts={}>}}})
Diff:
@@ -7,5 +7,5 @@
:workbench_id=>1019,
:name=>"subdir 0",
:file=>
- #<UploadIO:0x007f9bd144dbe8 @content_type="application/zip", @original_filename="subdir 0.zip", @local_path="local.path", @io=#<Double "subdir 0">, @opts={}>}}}]
+ #<UploadIO:0x007f9bd14a1450
@content_type="application/zip", @original_filename="subdir 0.zip", @local_path="/.../stif-boiv/tmp/imports/WorkbenchImport_subdir 0_38821.zip", @io=#<File:/.../stif-boiv/tmp/imports/WorkbenchImport_subdir 0_38821.zip>, @opts={}>}}}]
# ./app/workers/workbench_import_worker.rb:29:in `execute_post'
# ./app/workers/workbench_import_worker.rb:59:in `upload_entry_group'
# ./app/workers/workbench_import_worker.rb:38:in `each'
# ./app/workers/workbench_import_worker.rb:38:in `each_with_index'
# ./app/workers/workbench_import_worker.rb:38:in `upload'
# ./app/workers/workbench_import_worker.rb:15:in `perform'
# ./spec/workers/workbench_import_worker_spec.rb:105:in `block (3 levels) in <top (required)>'
# -e:1:in `<main>'
To get around this, decided to just mock the `HTTPService#upload` method
because I don't really care about these attributes.
|
|
Since the concept of `entry_groups` was changed to `subdirs`, this
change needs to be reflected in the tests.
Instead of looping over `entry_groups`, we now loop over `subdirs`, and
pass this object directly to `mock_post`.
The `mock_post` helper is now rewritten to reflect the new structure
of post parameters. Remove the `params` `let` because it's not used
anywhere else and we need to pass the arguments to `mock_post` into it.
This currently errors because `Faraday::UploadIO` isn't passed the
parameters that are expected in `mock_post`.
|
|
This changed in the new `ZipService`. We're now using a `Subdir` object,
we we need to use that in the tests instead of the
`entry_group_streams`.
|
|
The code in `#perform` now updates the `started_at` time field which
breaks the existing mocks. Update them to match the code. Yes, T-not-DD.
|
|
Don't skip these any more. Working to figure out how to make new specs
that work with the new code.
|
|
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.
|
|
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.
|
|
- Added tests for HTTPService (regression)
- Removed some dead code (Workbench model spec, Import factory)
- Changed front_end_host to rails_host in config
|
|
|
|
|
|
|
|
- speced and implemented Import instance behavior (status, total_steps, current_step)
- failure behavior and it's impact to the above
|
|
- speced but missing error treatment
|
|
|
|
File.open(..., r) in a configurable directory [amend me]
|
|
- Setting up correct headers for the Webmock request (Oh Boy)
- Refactoring all Faraday requests into `lib/af83/http_fetcher.rb`
- Implementing the Download
|
|
Introduction of Presence Validation in Import model, for:
- workbench
- referential
|
|
|
|
|
|
|
|
|
|
|
|
lib/af83/stored_procedures.rb for sql stored procedure management; Refs #2864
|