Skip to content

Conversation

@absurdfarce
Copy link
Collaborator

No description provided.

import yaml

from itertools import chain

Copy link
Collaborator Author

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
Copy link
Collaborator Author

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()]}
Copy link
Collaborator Author

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"
Copy link
Collaborator Author

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)
Copy link
Collaborator Author

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.

@absurdfarce absurdfarce linked an issue Jun 2, 2021 that may be closed by this pull request
@absurdfarce
Copy link
Collaborator Author

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.

@absurdfarce absurdfarce changed the title 129 make template vars great again 129 Make cycles, scenarioname NB template variables by default Jun 10, 2021
@absurdfarce absurdfarce self-assigned this Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NB template - allow setting cycles as template param

2 participants