Improve MaxCtrl test coverage
A few missing cases that simple to solve were reported by the coverage tool.
This commit is contained in:
parent
46dee98b25
commit
57471c7baa
@ -16,7 +16,7 @@ describe("API", function() {
|
||||
})
|
||||
})
|
||||
|
||||
it('sums integer values', function() {
|
||||
it('sums zero integer values', function() {
|
||||
return doCommand('api get servers data[].attributes.statistics.connections --sum')
|
||||
.then((res) => {
|
||||
js = JSON.parse(res)
|
||||
@ -24,6 +24,14 @@ describe("API", function() {
|
||||
})
|
||||
})
|
||||
|
||||
it('sums non-zero integer values', function() {
|
||||
return doCommand('api get --sum maxscale/threads data[].attributes.stats.reads')
|
||||
.then((res) => {
|
||||
js = JSON.parse(res)
|
||||
js.should.be.a('number')
|
||||
})
|
||||
})
|
||||
|
||||
it('does not sum string values', function() {
|
||||
return doCommand('api get servers data[].id --sum')
|
||||
.then((res) => {
|
||||
|
@ -20,5 +20,10 @@ describe("Module Commands", function() {
|
||||
.should.be.rejected
|
||||
})
|
||||
|
||||
it('call unknown command', function() {
|
||||
return doCommand('call command mariadbmon log')
|
||||
.should.be.rejected
|
||||
})
|
||||
|
||||
after(stopMaxScale)
|
||||
});
|
||||
|
@ -239,5 +239,16 @@ describe("Create/Destroy Commands", function() {
|
||||
.should.be.fulfilled
|
||||
})
|
||||
|
||||
it('create filter with no parameters', function() {
|
||||
return verifyCommand('create filter test-filter hintfilter',
|
||||
'filters/test-filter')
|
||||
.should.be.fulfilled
|
||||
})
|
||||
|
||||
it('destroy filter with no parameters', function() {
|
||||
return doCommand('destroy filter test-filter')
|
||||
.should.be.fulfilled
|
||||
})
|
||||
|
||||
after(stopMaxScale)
|
||||
});
|
||||
|
@ -10,6 +10,7 @@ var tests = [
|
||||
'list modules',
|
||||
'list users',
|
||||
'list commands',
|
||||
'list threads',
|
||||
'show servers',
|
||||
'show services',
|
||||
'show monitors',
|
||||
@ -19,6 +20,7 @@ var tests = [
|
||||
'show maxscale',
|
||||
'show logging',
|
||||
'show threads',
|
||||
'show thread 0',
|
||||
'show server server1',
|
||||
'show service RW-Split-Router',
|
||||
'show monitor MariaDB-Monitor',
|
||||
|
@ -70,6 +70,11 @@ describe("Library invocation", function() {
|
||||
.should.be.fulfilled
|
||||
})
|
||||
|
||||
it('no command', function() {
|
||||
return ctrl.execute([], {})
|
||||
.should.be.rejected
|
||||
})
|
||||
|
||||
it('reject on connection failure', function() {
|
||||
stopMaxScale()
|
||||
.then(function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user