[ARVADOS] updated: 604a84ddb5c4d410889c0d7ae9c7c15a595c181d
git at public.curoverse.com
git at public.curoverse.com
Mon Dec 29 17:01:40 EST 2014
Summary of changes:
sdk/go/keepclient/keepclient_test.go | 81 ++++++------
sdk/python/setup.py | 2 +-
.../20140422011506_pipeline_instance_state.rb | 9 +-
.../db/migrate/20141208164553_owner_uuid_index.rb | 20 +++
services/api/db/structure.sql | 139 ++++++++++++++++++++-
services/api/test/unit/arvados_model_test.rb | 23 ++++
services/fuse/setup.py | 2 +-
services/nodemanager/setup.py | 2 +-
8 files changed, 224 insertions(+), 54 deletions(-)
create mode 100644 services/api/db/migrate/20141208164553_owner_uuid_index.rb
via 604a84ddb5c4d410889c0d7ae9c7c15a595c181d (commit)
via 3212cecb5c090d2f331fd964a8855eaad508fdb9 (commit)
via 68c8b2056d6c72f0229cf29f999a8e0a1e4231f9 (commit)
via 4afcb8c40cf29b43a457b02123e8532b41df9afd (commit)
via 1e31ae09539d8265820a2f75f8a981f7d415ef58 (commit)
via 0ab83774eb4a234eea75686dd257da4dd799aef8 (commit)
via 2c62646581af6cc6d7858262a15ecd596730b3dd (commit)
via 1e7641831c41f9a7b27aa2672211f6d607e8ff8e (commit)
via c47e7b17f55d546b4158ab4b0d61b8f7e081ef57 (commit)
via 14421881c1962fdfba49dc004cfc69c0637fe454 (commit)
via b12343e7eec124b34139efae07b52e95a74b253a (commit)
via 155e542971974020412ad41d22e616290be5cc94 (commit)
from 420d88e40bc5c2d12fe53a5f9f25ec19d80de797 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 604a84ddb5c4d410889c0d7ae9c7c15a595c181d
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Dec 29 17:02:01 2014 -0500
Fix whitespace, cf. gofmt. refs #4875
diff --git a/sdk/go/keepclient/keepclient_test.go b/sdk/go/keepclient/keepclient_test.go
index 2174cb4..8487e00 100644
--- a/sdk/go/keepclient/keepclient_test.go
+++ b/sdk/go/keepclient/keepclient_test.go
@@ -474,7 +474,7 @@ func (s *StandaloneSuite) TestGet(c *C) {
arv, err := arvadosclient.MakeArvadosClient()
kc, _ := MakeKeepClient(&arv)
arv.ApiToken = "abc123"
- kc.SetServiceRoots(map[string]string{"x":ks.url})
+ kc.SetServiceRoots(map[string]string{"x": ks.url})
r, n, url2, err := kc.Get(hash)
defer r.Close()
@@ -500,7 +500,7 @@ func (s *StandaloneSuite) TestGetFail(c *C) {
arv, err := arvadosclient.MakeArvadosClient()
kc, _ := MakeKeepClient(&arv)
arv.ApiToken = "abc123"
- kc.SetServiceRoots(map[string]string{"x":ks.url})
+ kc.SetServiceRoots(map[string]string{"x": ks.url})
r, n, url2, err := kc.Get(hash)
c.Check(err, Equals, BlockNotFound)
@@ -530,7 +530,7 @@ func (s *StandaloneSuite) TestChecksum(c *C) {
arv, err := arvadosclient.MakeArvadosClient()
kc, _ := MakeKeepClient(&arv)
arv.ApiToken = "abc123"
- kc.SetServiceRoots(map[string]string{"x":ks.url})
+ kc.SetServiceRoots(map[string]string{"x": ks.url})
r, n, _, err := kc.Get(barhash)
_, err = ioutil.ReadAll(r)
commit 3212cecb5c090d2f331fd964a8855eaad508fdb9
Merge: 4afcb8c 68c8b20
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Dec 29 16:59:35 2014 -0500
Merge branch '4875-keepclient-test-race' closes #4875
commit 4afcb8c40cf29b43a457b02123e8532b41df9afd
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Dec 29 15:45:30 2014 -0500
Fix version strings to comply with PEP-440. No issue #
diff --git a/sdk/python/setup.py b/sdk/python/setup.py
index d96053d..754d89b 100644
--- a/sdk/python/setup.py
+++ b/sdk/python/setup.py
@@ -24,7 +24,7 @@ class TagBuildWithCommit(egg_info):
assert len(git_tags) == 2
git_tags[0] = time.strftime(
'%Y%m%d%H%M%S', time.gmtime(int(git_tags[0])))
- self.tag_build = '.{}.{}'.format(*git_tags)
+ self.tag_build = '.{}+{}'.format(*git_tags)
return egg_info.tags(self)
diff --git a/services/fuse/setup.py b/services/fuse/setup.py
index c9ea98c..43b563a 100644
--- a/services/fuse/setup.py
+++ b/services/fuse/setup.py
@@ -24,7 +24,7 @@ class TagBuildWithCommit(egg_info):
assert len(git_tags) == 2
git_tags[0] = time.strftime(
'%Y%m%d%H%M%S', time.gmtime(int(git_tags[0])))
- self.tag_build = '.{}.{}'.format(*git_tags)
+ self.tag_build = '.{}+{}'.format(*git_tags)
return egg_info.tags(self)
diff --git a/services/nodemanager/setup.py b/services/nodemanager/setup.py
index a687c82..5fc4294 100644
--- a/services/nodemanager/setup.py
+++ b/services/nodemanager/setup.py
@@ -23,7 +23,7 @@ class TagBuildWithCommit(egg_info):
assert len(git_tags) == 2
git_tags[0] = time.strftime(
'%Y%m%d%H%M%S', time.gmtime(int(git_tags[0])))
- self.tag_build = '.{}.{}'.format(*git_tags)
+ self.tag_build = '.{}+{}'.format(*git_tags)
return egg_info.tags(self)
commit 1e31ae09539d8265820a2f75f8a981f7d415ef58
Merge: 420d88e 0ab8377
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Dec 29 15:12:46 2014 -0500
Merge branch '4523-owner_uuid-index' refs #4523
commit 0ab83774eb4a234eea75686dd257da4dd799aef8
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Dec 29 13:58:58 2014 -0500
4523: Dry up migration and test cases.
diff --git a/services/api/db/migrate/20141208164553_owner_uuid_index.rb b/services/api/db/migrate/20141208164553_owner_uuid_index.rb
index 9ba0c5a..0859d46 100644
--- a/services/api/db/migrate/20141208164553_owner_uuid_index.rb
+++ b/services/api/db/migrate/20141208164553_owner_uuid_index.rb
@@ -1,15 +1,9 @@
class OwnerUuidIndex < ActiveRecord::Migration
def tables_with_owner_uuid
- all_tables = ActiveRecord::Base.connection.tables
- my_tables = []
- all_tables.each do |table|
+ ActiveRecord::Base.connection.tables.select do |table|
columns = ActiveRecord::Base.connection.columns(table)
- uuid_column = columns.select do |column|
- column.name == 'owner_uuid'
- end
- my_tables << table if !uuid_column.empty?
+ columns.collect(&:name).include? 'owner_uuid'
end
- my_tables
end
def up
diff --git a/services/api/test/unit/arvados_model_test.rb b/services/api/test/unit/arvados_model_test.rb
index be78c83..8c75764 100644
--- a/services/api/test/unit/arvados_model_test.rb
+++ b/services/api/test/unit/arvados_model_test.rb
@@ -87,43 +87,26 @@ class ArvadosModelTest < ActiveSupport::TestCase
end
end
- test "unique uuid index exists on all models with the column uuid" do
- tables = ActiveRecord::Base.connection.tables
- tables.each do |table|
- columns = ActiveRecord::Base.connection.columns(table)
-
- uuid_column = columns.select do |column|
- column.name == 'uuid'
- end
-
- if !uuid_column.empty?
- indexes = ActiveRecord::Base.connection.indexes(table)
- uuid_index = indexes.select do |index|
- index.columns == ['uuid'] and index.unique == true
- end
-
- assert !uuid_index.empty?, "#{table} does not have unique uuid index"
- end
- end
- end
-
- test "owner uuid index exists on all models with the owner_uuid column" do
- all_tables = ActiveRecord::Base.connection.tables
-
- all_tables.each do |table|
- columns = ActiveRecord::Base.connection.columns(table)
-
- uuid_column = columns.select do |column|
- column.name == 'owner_uuid'
- end
-
- if !uuid_column.empty?
- indexes = ActiveRecord::Base.connection.indexes(table)
- owner_uuid_index = indexes.select do |index|
- index.columns == ['owner_uuid']
+ [['uuid', {unique: true}],
+ ['owner_uuid', {}]].each do |the_column, requires|
+ test "unique index on all models with #{the_column}" do
+ checked = 0
+ ActiveRecord::Base.connection.tables.each do |table|
+ columns = ActiveRecord::Base.connection.columns(table)
+
+ next unless columns.collect(&:name).include? the_column
+
+ indexes = ActiveRecord::Base.connection.indexes(table).reject do |index|
+ requires.map do |key, val|
+ index.send(key) == val
+ end.include? false
end
- assert !owner_uuid_index.empty?, "#{table} does not have owner_uuid index"
+ assert_includes indexes.collect(&:columns), [the_column], 'no index'
+ checked += 1
end
+ # Sanity check: make sure we didn't just systematically miss everything.
+ assert_operator(10, :<, checked,
+ "Only #{checked} tables have a #{the_column}?!")
end
end
end
commit 2c62646581af6cc6d7858262a15ecd596730b3dd
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Dec 29 12:45:02 2014 -0500
4523: Fix column order to match migration order.
diff --git a/services/api/db/structure.sql b/services/api/db/structure.sql
index 2862f0b..038973f 100644
--- a/services/api/db/structure.sql
+++ b/services/api/db/structure.sql
@@ -685,9 +685,9 @@ CREATE TABLE pipeline_instances (
properties text,
state character varying(255),
components_summary text,
- description text,
started_at timestamp without time zone,
- finished_at timestamp without time zone
+ finished_at timestamp without time zone,
+ description text
);
commit 1e7641831c41f9a7b27aa2672211f6d607e8ff8e
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Dec 29 12:44:35 2014 -0500
4523: Remove dev-only checks in migration.
diff --git a/services/api/db/migrate/20140422011506_pipeline_instance_state.rb b/services/api/db/migrate/20140422011506_pipeline_instance_state.rb
index 6034c98..7643b18 100644
--- a/services/api/db/migrate/20140422011506_pipeline_instance_state.rb
+++ b/services/api/db/migrate/20140422011506_pipeline_instance_state.rb
@@ -2,13 +2,8 @@ class PipelineInstanceState < ActiveRecord::Migration
include CurrentApiClient
def up
- if !column_exists?(:pipeline_instances, :state)
- add_column :pipeline_instances, :state, :string
- end
-
- if !column_exists?(:pipeline_instances, :components_summary)
- add_column :pipeline_instances, :components_summary, :text
- end
+ add_column :pipeline_instances, :state, :string
+ add_column :pipeline_instances, :components_summary, :text
PipelineInstance.reset_column_information
commit c47e7b17f55d546b4158ab4b0d61b8f7e081ef57
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Dec 29 12:28:44 2014 -0500
4523: Fix whitespace.
diff --git a/services/api/test/unit/arvados_model_test.rb b/services/api/test/unit/arvados_model_test.rb
index a3b7adc..be78c83 100644
--- a/services/api/test/unit/arvados_model_test.rb
+++ b/services/api/test/unit/arvados_model_test.rb
@@ -87,7 +87,7 @@ class ArvadosModelTest < ActiveSupport::TestCase
end
end
- test "unique uuid index exists on all models with the column uuid" do
+ test "unique uuid index exists on all models with the column uuid" do
tables = ActiveRecord::Base.connection.tables
tables.each do |table|
columns = ActiveRecord::Base.connection.columns(table)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list