Skip to content
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

Assert target application server is the same type recording was created with #36

Merged
merged 17 commits into from
Jun 14, 2019

Conversation

alandipert
Copy link
Contributor

@alandipert alandipert commented Jun 7, 2019

Please see rstudio/shinyloadtest#107 for details and discussion.

@alandipert alandipert added Priority: Medium Could be fixed before next release Difficulty: Advanced Best for maintainers to address Type: Enhancement Adds a new, backwards-compatible feature Effort: Low < 1 day of work labels Jun 7, 2019
@alandipert alandipert self-assigned this Jun 7, 2019
xpath(resp.body, "/html/head/script")
.flatMap { List(it.attributes.length, { i -> it.attributes.item(i)}) }
.filter { it.nodeName == "src" }
.find { it.nodeValue.matches("^.*/shiny.min.js$".toRegex()) }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to escape dots and also check for shiny.js too

fun readProps(lines: List<String>, logger: Logger): Props {
val props = lines.asSequence()
.takeWhile { it.startsWith("#") }
.map { readPropLine(it) }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why doesn't .map(readPropLine) work?

logger.warn("Recording made with '${rec.props.targetType.typeName}' but target looks like '${detectedType.typeName}'")
}

if (rec.props.version < RECORDING_VERSION) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to warn because there won't necessarily be a problem

.takeWhile { it.startsWith("#") }
.map { readPropLine(it) }
.toMap()
if (props.containsKey("target")) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to accept old recordings, no need to warn

alandipert added a commit to rstudio/shinyloadtest that referenced this pull request Jun 14, 2019
@alandipert alandipert marked this pull request as ready for review June 14, 2019 21:22
@alandipert alandipert merged commit c196de2 into master Jun 14, 2019
@alandipert alandipert deleted the check-target-server-type branch June 14, 2019 21:23
@alandipert alandipert mentioned this pull request Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty: Advanced Best for maintainers to address Effort: Low < 1 day of work Priority: Medium Could be fixed before next release Type: Enhancement Adds a new, backwards-compatible feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant