129 Make cycles, scenarioname NB template variables by default#148
129 Make cycles, scenarioname NB template variables by default#148absurdfarce wants to merge 6 commits intomasterfrom
Conversation
…onfig construction time (i.e. no template params)
| import yaml | ||
|
|
||
| from itertools import chain | ||
|
|
There was a problem hiding this comment.
Just a bit of cleanup... apparently this wasn't used anymore
| self.numeric_max = \ | ||
| min((self.rampup_cycles + self.main_cycles) * 1000, MAX_NUMERIC_VAL) \ | ||
| if self.rampup_cycles and self.main_cycles \ | ||
| else MAX_NUMERIC_VAL |
There was a problem hiding this comment.
This reflects the maximum size we can get for numeric values. If the number of cycles is specified we can use this to constrain the number of values in order to increase the likelihood of hits when we do selects on primary keys.
| root = {} | ||
|
|
||
| root["scenarios"] = {"TEMPLATE(scenarioname,default)":[self.__get_rampup_scenario(), self.__get_main_scenario()]} | ||
| root["scenarios"] = {self.scenario_name or TEMPLATEVAR_SCENARIO_NAME:[self.__get_rampup_scenario(), self.__get_main_scenario()]} |
There was a problem hiding this comment.
Note that in all three cases the template var is the default case. If the user doesn't explicitly specify a val via the CLI args we use the template var instead.
|
|
||
|
|
||
| def nbBaseSchema(self): | ||
| return "tests/integration/resources/nb-base-schema.cql" |
There was a problem hiding this comment.
Some file cleanup. Patterns were developing in the tests around referencing base + expected CQL/YAML but many of the tests were still manipulating raw paths. Goal here is to consolidate that logic in the framework so that it only has to be implemented once.
| root["blocks"] = [rampup_block, main_read_block, main_write_block] | ||
|
|
||
| return yaml.dump(root, default_flow_style=False) | ||
| return yaml.safe_dump(root, default_flow_style=False) |
There was a problem hiding this comment.
We were seeing cases in which the YAML dump was writing a serialized Python Unicode string here which wound up with something like "!!python/unicode foo". PyYAML supports serializing arbitrary Python types; safe_dump() requires the output to be a base string, which is exactly what we want here.
|
The testing bits here are going to be in a bad way in light of #152. I think it's prolly best to get that PR merged and then re-work this guy so that he plays nice with the new integration test regime. |
No description provided.