<feed xmlns='http://www.w3.org/2005/Atom'>
<title>chouette-core/spec/workers, branch 4655-dashboard-controller</title>
<subtitle>Chouette manage transport static data</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/'/>
<entry>
<title>Avoid Appartment schema creation when cloning is pending. Add a spec which performs a real referential clone. Refs #4335</title>
<updated>2017-09-07T13:38:34+00:00</updated>
<author>
<name>Alban Peignier</name>
</author>
<published>2017-09-07T13:38:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=7603900279d8578724944d4e20e910c7fc7f0549'/>
<id>7603900279d8578724944d4e20e910c7fc7f0549</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>WorkbenchImportWorker spec: Check `ended_at` update after import</title>
<updated>2017-09-05T12:41:13+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-09-05T12:41:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=23793ca8865501fcb0672ce7e62d1e0b6417d0bd'/>
<id>23793ca8865501fcb0672ce7e62d1e0b6417d0bd</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>WorkbenchImportWorker spec: Catch `StopIteration` exception</title>
<updated>2017-09-05T11:22:11+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-09-05T11:22:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=1485d68a3bef38fa3ed61cf610855861cea405b7'/>
<id>1485d68a3bef38fa3ed61cf610855861cea405b7</id>
<content type='text'>
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=&gt;"What was you thinking"}, got #&lt;StopIteration: {:error=&gt;"What was you thinking"}&gt; 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 &lt;top (required)&gt;'
           # ./spec/workers/workbench_import_worker_spec.rb:105:in `block (3 levels) in &lt;top (required)&gt;'
           # -e:1:in `&lt;main&gt;'
       # ./spec/workers/workbench_import_worker_spec.rb:105:in `block (3 levels) in &lt;top (required)&gt;'
       # -e:1:in `&lt;main&gt;'

In order to get around this, just catch the error. Hopefully this is
right.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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=&gt;"What was you thinking"}, got #&lt;StopIteration: {:error=&gt;"What was you thinking"}&gt; 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 &lt;top (required)&gt;'
           # ./spec/workers/workbench_import_worker_spec.rb:105:in `block (3 levels) in &lt;top (required)&gt;'
           # -e:1:in `&lt;main&gt;'
       # ./spec/workers/workbench_import_worker_spec.rb:105:in `block (3 levels) in &lt;top (required)&gt;'
       # -e:1:in `&lt;main&gt;'

In order to get around this, just catch the error. Hopefully this is
right.
</pre>
</div>
</content>
</entry>
<entry>
<title>WorkbenchImportWorker spec: Mock upload params</title>
<updated>2017-09-05T11:19:13+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-09-05T11:19:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=edbdd5a05fb9b75a6565c31f37d1ce8a501db265'/>
<id>edbdd5a05fb9b75a6565c31f37d1ce8a501db265</id>
<content type='text'>
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=&gt;"http://www.example.com", :path=&gt;"/api/v1/netex_imports.json", :params=&gt;{:netex_import=&gt;{:par... @original_filename="subdir 0.zip", @local_path="local.path", @io=#&lt;Double "subdir 0"&gt;, @opts={}&gt;}}})
                got: ({:host=&gt;"http://www.example.com", :path=&gt;"/api/v1/netex_imports.json", :params=&gt;{:netex_import=&gt;{:par.../stif-boiv/tmp/imports/WorkbenchImport_subdir 0_38821.zip&gt;, @opts={}&gt;}}})
         Diff:
         @@ -7,5 +7,5 @@
                :workbench_id=&gt;1019,
                :name=&gt;"subdir 0",
                :file=&gt;
         -       #&lt;UploadIO:0x007f9bd144dbe8 @content_type="application/zip", @original_filename="subdir 0.zip", @local_path="local.path", @io=#&lt;Double "subdir 0"&gt;, @opts={}&gt;}}}]
         +       #&lt;UploadIO:0x007f9bd14a1450
         @content_type="application/zip", @original_filename="subdir 0.zip", @local_path="/.../stif-boiv/tmp/imports/WorkbenchImport_subdir 0_38821.zip", @io=#&lt;File:/.../stif-boiv/tmp/imports/WorkbenchImport_subdir 0_38821.zip&gt;, @opts={}&gt;}}}]

       # ./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 &lt;top (required)&gt;'
       # -e:1:in `&lt;main&gt;'

To get around this, decided to just mock the `HTTPService#upload` method
because I don't really care about these attributes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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=&gt;"http://www.example.com", :path=&gt;"/api/v1/netex_imports.json", :params=&gt;{:netex_import=&gt;{:par... @original_filename="subdir 0.zip", @local_path="local.path", @io=#&lt;Double "subdir 0"&gt;, @opts={}&gt;}}})
                got: ({:host=&gt;"http://www.example.com", :path=&gt;"/api/v1/netex_imports.json", :params=&gt;{:netex_import=&gt;{:par.../stif-boiv/tmp/imports/WorkbenchImport_subdir 0_38821.zip&gt;, @opts={}&gt;}}})
         Diff:
         @@ -7,5 +7,5 @@
                :workbench_id=&gt;1019,
                :name=&gt;"subdir 0",
                :file=&gt;
         -       #&lt;UploadIO:0x007f9bd144dbe8 @content_type="application/zip", @original_filename="subdir 0.zip", @local_path="local.path", @io=#&lt;Double "subdir 0"&gt;, @opts={}&gt;}}}]
         +       #&lt;UploadIO:0x007f9bd14a1450
         @content_type="application/zip", @original_filename="subdir 0.zip", @local_path="/.../stif-boiv/tmp/imports/WorkbenchImport_subdir 0_38821.zip", @io=#&lt;File:/.../stif-boiv/tmp/imports/WorkbenchImport_subdir 0_38821.zip&gt;, @opts={}&gt;}}}]

       # ./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 &lt;top (required)&gt;'
       # -e:1:in `&lt;main&gt;'

To get around this, decided to just mock the `HTTPService#upload` method
because I don't really care about these attributes.
</pre>
</div>
</content>
</entry>
<entry>
<title>WorkbenchImportWorker spec: Use `subdirs` in place of `entry_groups`</title>
<updated>2017-09-05T11:10:42+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-09-05T11:10:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=1c3148a40966f0457117e317bb1144967d39c839'/>
<id>1c3148a40966f0457117e317bb1144967d39c839</id>
<content type='text'>
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`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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`.
</pre>
</div>
</content>
</entry>
<entry>
<title>WorkbenchImportWorker spec: Change `entry_group_streams` to `subdirs`</title>
<updated>2017-09-04T14:50:19+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-09-04T14:50:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=bf56f221a0eedbceea99a1e20c2876383aa6c0dd'/>
<id>bf56f221a0eedbceea99a1e20c2876383aa6c0dd</id>
<content type='text'>
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`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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`.
</pre>
</div>
</content>
</entry>
<entry>
<title>WorkbenchImportWorker spec: Allow mock call to update `started_at`</title>
<updated>2017-08-31T09:51:26+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-31T09:51:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=7e62487561b85831ba7dfedbf47ee614a0880842'/>
<id>7e62487561b85831ba7dfedbf47ee614a0880842</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>WorkbenchImportWorker spec: Reinstate tests</title>
<updated>2017-08-31T09:41:06+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-31T09:41:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=e19c13975c84cf3cc7d54ab687bfa788a7dcd2bd'/>
<id>e19c13975c84cf3cc7d54ab687bfa788a7dcd2bd</id>
<content type='text'>
Don't skip these any more. Working to figure out how to make new specs
that work with the new code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Don't skip these any more. Working to figure out how to make new specs
that work with the new code.
</pre>
</div>
</content>
</entry>
<entry>
<title>Temporarily skip WorkbenchImportWorker tests</title>
<updated>2017-08-25T13:49:23+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-25T13:49:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=1994b1f0fdb4f74102bf61c8a3791af59860597a'/>
<id>1994b1f0fdb4f74102bf61c8a3791af59860597a</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>WorkbenchImportWorker spec: Change `#update_attributes` to `#update`</title>
<updated>2017-08-25T10:17:38+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-08-25T10:17:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/fork/chouette-core/commit/?id=e18419a1b829cc790f384a80995e6de544e5ff40'/>
<id>e18419a1b829cc790f384a80995e6de544e5ff40</id>
<content type='text'>
Now that the code has been changed to use `#update`, update these test
mocks to bind to the right method.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that the code has been changed to use `#update`, update these test
mocks to bind to the right method.
</pre>
</div>
</content>
</entry>
</feed>
