-
Notifications
You must be signed in to change notification settings - Fork 3
129 Make cycles, scenarioname NB template variables by default #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…onfig construction time (i.e. no template params)
| import yaml | ||
|
|
||
| from itertools import chain | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.