Hi Ronelle: On 20/11/12 20:18, [email protected] wrote: > Hi, > > This is the first cut at tests following > http://members.dmtf.org/apps/org/workgroup/vcmf/download.php/68964/cimiTest.html. >
excellent - great to see these starting to take shape - generally speaking this is a great first cut. > - part5_test.rb will fail on checking status after /stop /start. I think > this a real issue as executing /stop /start resturns a 200 but the state > never changes > - part3_test.rb just leaves a comment that Deltacloud CIMI does not support > MachineTemplates right now > - cep_test.rb doubles as part1 > - part4_test.rb is incomplete - please see > https://issues.apache.org/jira/browse/DTACLOUD-375 fixed this - ready for testing please (patches at http://tracker.deltacloud.org/set/145) - I set jira to resolved if it works close it otherwise reassign to me > - Tests are written to be run with the mock provider, as they stand, in as > much as we would need to include polling after a action is executed on a real > provider. I am open to adding this polling now so that the tests are > compatible with all providers we test right. well, we do the polling for the deltacloud equivalent tests (e.g. for cleaning up created resources machines etc) so I don't think this is a problem. I'm not sure what will be tested at the plugfest - perhaps only mock (David's input required here). Besides setting up the polling, another thing to do is make sure the right creds are parsed from the config file (right now there is only one set under 'cimi') - you could reuse the creds from the deltacloud section of the config file. However you'd still need driver specific sections under cimi for the 'preferred' bits. > - Comments for improvement please ... I tidied up the 'check_cep' bit - since as you mention in your code comments this code is a bit repetitive. See http://tracker.deltacloud.org/set/144 patch 1/2 (patch 2 is your code). You can apply patch 1 ontop of your code. Basically I moved the 'cep' test to the CIMI::Test::Methods in test_helper... so in part2_test for example the it "should have root collections" do ... becomes query_the_cep(["machines", "machineImages", "machineConfigurations"]) and you can just include this wherever you need to check cep for particular collections. This is just a suggestion, use/scrap/change as you see fit. One final note: sorry to be pedantic :( but we say this to everyone so ... can you please get rid of the extraneous whitespace? I don't know what editor you are using but fwiw, if you're using vim - edit your .vimrc file in $HOME to include: #at the top function Nukespace() let flags = 'w' if search('\s\+$', flags) > 0 %s/\s\+$//gc else echo("CLEAN - NO WHITESPACE FOUND") endif :endfunction map <silent> <F12> :call Nukespace()<CR> highlight RedundantSpaces ctermbg=white guibg=white match RedundantSpaces /\s\+$\| \+\ze\t/ autocmd BufWritePre * windo call Nukespace( so when you press F12 - it will clear all redundant whitespace - also when you write a buffer to save the file. This also highlights whitespace in white. marios >
