Project

Profile

Help

Task #6958

Define json schema of input config

Added by Mark Zaslavskiy about 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Timofey Turenko
Category:
mdbci features
Sprint/Milestone:
Start date:
12.04.2016
Due date:
% Done:

0%

Estimated time:
1:00 h
Target branch:
Test scenario:

Next line of code should confirm that config is vaid

./mdbci validate_template --template spec/test_machine_configurations/snapshot_test_libvirt.json

Tests could be done with files in confs directory

Try next(should be valid):

{
"maxscale" :
{
"hostname" : "maxscale",
"box" : "centos_7_libvirt",
"product" : {
"name" : "packages"
},
"memory_size" : "2048"
}
}


And in conf directory next files should be valid:

mdbci_box.json

mdbci_up_aws_test_config.json

docker_test.json

qemu-test-03.11.json

Also valid config now is empty json like:
{}


Description

Define schema for two cases:
- whole document
- aws node
- not aws node

Describe possible and required fields in schema, define types as detailed as possible.

Define conditional requirements in wiki page, for example field A should be defined when field B is defined


Related issues

Related to [mdbci] Maria DB Continuous integration tool - Task #6940: Configuration validator inside mdbciClosed06.04.2016

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Related to [mdbci] Maria DB Continuous integration tool - Task #6961: Add validate-config optionClosed12.04.2016

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Related to [mdbci] Maria DB Continuous integration tool - Task #7196: Add validate_template to help output of mdbciClosed06.07.2016

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by Mark Zaslavskiy about 5 years ago

  • Description updated (diff)

#2 Updated by Mark Zaslavskiy about 5 years ago

  • Description updated (diff)

#3 Updated by Mark Zaslavskiy about 5 years ago

  • Description updated (diff)

#4 Updated by Mark Zaslavskiy about 5 years ago

  • Related to Task #6940: Configuration validator inside mdbci added

#5 Updated by Alexander Kaluzhny about 5 years ago

  • Status changed from New to Active / In progress

#6 Updated by Mark Zaslavskiy about 5 years ago

Please add time estimation!

#7 Updated by Mark Zaslavskiy about 5 years ago

  • Status changed from Active / In progress to New

#8 Updated by Alexander Kaluzhny about 5 years ago

  • Status changed from New to Active / In progress

#9 Updated by Alexander Kaluzhny about 5 years ago

  • Test scenario updated (diff)

#10 Updated by Alexander Kaluzhny about 5 years ago

  • Test scenario updated (diff)

#11 Updated by Alexander Kaluzhny about 5 years ago

  • Status changed from Active / In progress to Review
  • Assignee changed from Alexander Kaluzhny to Ilfat Kinyaev

#12 Updated by Alexander Kaluzhny about 5 years ago

  • Related to Task #6961: Add validate-config option added

#13 Updated by Alexander Kaluzhny about 5 years ago

  • Status changed from Review to Active / In progress
  • Assignee changed from Ilfat Kinyaev to Alexander Kaluzhny

#14 Updated by Alexander Kaluzhny about 5 years ago

  • Status changed from Active / In progress to New

#15 Updated by Alexander Kaluzhny almost 5 years ago

  • Estimated time set to 1:00 h

#16 Updated by Alexander Kaluzhny almost 5 years ago

  • Status changed from New to Active / In progress

#17 Updated by Alexander Kaluzhny almost 5 years ago

  • Status changed from Active / In progress to Testing
  • Assignee changed from Alexander Kaluzhny to Mark Zaslavskiy

#18 Updated by Alexander Kaluzhny almost 5 years ago

  • Status changed from Testing to Review

#19 Updated by Alexander Kaluzhny almost 5 years ago

#20 Updated by Mark Zaslavskiy almost 5 years ago

  1. conflicts
  2. jenkins tests should be executed
  3. test scenario check failed
vood@vood-ThinkPad:~/ws/mdbci$ ./mdbci validate_template -e no_aws -t confs/mdbci_box.json 
./mdbci: invalid option -- e
/usr/lib/ruby/1.9.1/getoptlong.rb:394:in `set_error': invalid option -- e (GetoptLong::InvalidOption)
    from /usr/lib/ruby/1.9.1/getoptlong.rb:571:in `get'
    from /usr/lib/ruby/1.9.1/getoptlong.rb:602:in `block in each'
    from /usr/lib/ruby/1.9.1/getoptlong.rb:601:in `loop'
    from /usr/lib/ruby/1.9.1/getoptlong.rb:601:in `each'
    from ./mdbci:40:in `<main>'
vood@vood-ThinkPad:~/ws/mdbci$ vim mdbci 
vood@vood-ThinkPad:~/ws/mdbci$ ./mdbci validate_template -e no_aws -t confs/docker_test.json
./mdbci: invalid option -- e
/usr/lib/ruby/1.9.1/getoptlong.rb:394:in `set_error': invalid option -- e (GetoptLong::InvalidOption)
    from /usr/lib/ruby/1.9.1/getoptlong.rb:571:in `get'
    from /usr/lib/ruby/1.9.1/getoptlong.rb:602:in `block in each'
    from /usr/lib/ruby/1.9.1/getoptlong.rb:601:in `loop'
    from /usr/lib/ruby/1.9.1/getoptlong.rb:601:in `each'
    from ./mdbci:40:in `<main>'

#21 Updated by Mark Zaslavskiy almost 5 years ago

  • Status changed from Review to New
  • Assignee changed from Mark Zaslavskiy to Alexander Kaluzhny

#22 Updated by Alexander Kaluzhny almost 5 years ago

  • Status changed from New to Active / In progress

#23 Updated by Alexander Kaluzhny almost 5 years ago

  • Status changed from Active / In progress to Review
  • Assignee changed from Alexander Kaluzhny to Mark Zaslavskiy
  • Test scenario updated (diff)

#24 Updated by Mark Zaslavskiy almost 5 years ago

  • Status changed from Review to Merge

#25 Updated by Mark Zaslavskiy almost 5 years ago

  • Status changed from Merge to Testing
  • Assignee changed from Mark Zaslavskiy to Timofey Turenko

#26 Updated by Timofey Turenko almost 5 years ago

just tried one my working template:

vagrant@ns3014560:~/mdbci$ ./mdbci validate_template --template develop-testing-jun13.json
INFO: MariaDb CI CLI
INFO: mdbci called with: ["validate_template"]
INFO: Checking this machine configuration requirments
INFO: .....NOT IMPLEMENTED YET
INFO: Load Boxes from ./BOXES
INFO: Loaded boxes: 51
INFO: Load AWS config from aws-config.yml
INFO: Load Repos from ./repo.d
INFO: Looking up for repos ./repo.d
INFO: Loaded repos: 752
ERROR: Template develop-testing-jun13.json is NOT valid
ERROR: /home/vagrant/mdbci/core/session.rb:386:in `rescue in validate_template'
/home/vagrant/mdbci/core/session.rb:379:in `validate_template'
/home/vagrant/mdbci/core/session.rb:446:in `commands'
./mdbci:128:in `<main>'
ERROR: The property '#/maxscale/product' did not contain a required property of 'version'

definition of maxscale in this template:

  "maxscale" :
  {
        "hostname" : "maxscale",
        "box" : "centos_7_libvirt",
        "product" : {
                "name" : "packages" 
        },
        "memory_size" : "2048" 
  }

#27 Updated by Timofey Turenko almost 5 years ago

  • Status changed from Testing to Reopened

#28 Updated by Mark Zaslavskiy almost 5 years ago

  • Status changed from Reopened to New
  • Assignee changed from Timofey Turenko to Mark Zaslavskiy

#29 Updated by Mark Zaslavskiy almost 5 years ago

  • Assignee changed from Mark Zaslavskiy to Alexander Kaluzhny

#30 Updated by Alexander Kaluzhny almost 5 years ago

  • Status changed from New to Active / In progress

#31 Updated by Alexander Kaluzhny almost 5 years ago

  • Test scenario updated (diff)

#32 Updated by Alexander Kaluzhny almost 5 years ago

  • Test scenario updated (diff)

#33 Updated by Alexander Kaluzhny almost 5 years ago

  • Test scenario updated (diff)

#34 Updated by Alexander Kaluzhny almost 5 years ago

#35 Updated by Alexander Kaluzhny almost 5 years ago

  • Status changed from Active / In progress to Review

#36 Updated by Alexander Kaluzhny almost 5 years ago

  • Assignee changed from Alexander Kaluzhny to Mark Zaslavskiy

#37 Updated by Mark Zaslavskiy almost 5 years ago

  • Status changed from Review to Testing
  • Assignee changed from Mark Zaslavskiy to Timofey Turenko

#38 Updated by Mark Zaslavskiy almost 5 years ago

  • Sprint/Milestone changed from 0.83 to 0.9

#39 Updated by Timofey Turenko almost 5 years ago

  • Status changed from Testing to Reopened

information about new command ('validate_templte') is not added to help output!

#40 Updated by Alexander Kaluzhny almost 5 years ago

  • Status changed from Reopened to Active / In progress
  • Assignee changed from Timofey Turenko to Alexander Kaluzhny

#41 Updated by Alexander Kaluzhny almost 5 years ago

Timofey Turenko wrote:

information about new command ('validate_templte') is not added to help output!

Done in https://dev.osll.ru/issues/7196

#42 Updated by Alexander Kaluzhny almost 5 years ago

  • Related to Task #7196: Add validate_template to help output of mdbci added

#43 Updated by Alexander Kaluzhny almost 5 years ago

  • Status changed from Active / In progress to Review
  • Assignee changed from Alexander Kaluzhny to Timofey Turenko

#44 Updated by Alexander Kaluzhny almost 5 years ago

  • Status changed from Review to Testing

#45 Updated by Timofey Turenko almost 5 years ago

  • Status changed from Testing to Closed

Also available in: Atom PDF