Skip to content

Commit 5b227b9

Browse files
committed
Improve tests
According graphql syntax scalar values must not have subsections and objects must have subsections. Follow-up b587e47
1 parent 448eb40 commit 5b227b9

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

test/integration/api_query_test.lua

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,7 @@ function g.test_server_info_schema()
223223
local field_name_replica = fields_from_map(data['replication_fields'], 'name')
224224
local field_name_cartridge = fields_from_map(data['cartridge_fields'], 'name')
225225

226-
local resp = router:graphql({
227-
query = string.format(
226+
local query = string.format(
228227
[[
229228
{
230229
servers {
@@ -242,10 +241,13 @@ function g.test_server_info_schema()
242241
table.concat(field_name_storage, ' '),
243242
table.concat(field_name_network, ' '),
244243
table.concat(field_name_replica, ' '),
245-
table.concat(field_name_cartridge, ' ')
246-
-- workaround composite graphql type
244+
table.concat(field_name_cartridge, ' '))
245+
-- workaround composite graphql type
247246
:gsub('error', 'error {}')
248-
)
247+
:gsub('replication_info', 'replication_info {}')
248+
249+
local resp = router:graphql({
250+
query = query,
249251
})
250252
log.info(resp['data']['servers'][1])
251253
end
@@ -289,7 +291,7 @@ function g.test_servers()
289291
uri
290292
uuid
291293
alias
292-
labels
294+
labels { }
293295
disabled
294296
priority
295297
replicaset { roles }

test/integration/disable_test.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function g.test_api_disable()
4545

4646
g.cluster.main_server:graphql({query = [[
4747
mutation {
48-
cluster { disable_servers(uuids: ["bbbbbbbb-bbbb-0000-0000-000000000001"]) }
48+
cluster { disable_servers(uuids: ["bbbbbbbb-bbbb-0000-0000-000000000001"]) {} }
4949
}
5050
]]})
5151

test/integration/failover_stateful_test.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ function g.test_leader_promote()
315315
failover_promote(
316316
replicaset_uuid: $replicaset_uuid
317317
instance_uuid: $instance_uuid
318-
) {}
318+
)
319319
}
320320
}]],
321321
variables = {

test/unit/topology_test.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ function g.before_all()
100100
assert(roles.register_role('cartridge.roles.vshard-storage'))
101101
assert(roles.register_role('cartridge.roles.vshard-router'))
102102

103-
_G.vshard = {
103+
rawset(_G, 'vshard', {
104104
storage = {
105105
buckets_count = function() end,
106106
}
107-
}
107+
})
108108

109109
g.membership_backup = {}
110110
g.pool_backup = {}

0 commit comments

Comments
 (0)