{"action":"opened","issue":{"url":"https://api.github.com/repos/rstudio/shinytest/issues/177","repository_url":"https://api.github.com/repos/rstudio/shinytest","labels_url":"https://api.github.com/repos/rstudio/shinytest/issues/177/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/shinytest/issues/177/comments","events_url":"https://api.github.com/repos/rstudio/shinytest/issues/177/events","html_url":"https://github.com/rstudio/shinytest/issues/177","id":305680818,"number":177,"title":"sd_startShiny: shinytest defaults to random port","user":{"login":"horowitza","id":3465222,"avatar_url":"https://avatars0.githubusercontent.com/u/3465222?v=4","gravatar_id":"","url":"https://api.github.com/users/horowitza","html_url":"https://github.com/horowitza","followers_url":"https://api.github.com/users/horowitza/followers","following_url":"https://api.github.com/users/horowitza/following{/other_user}","gists_url":"https://api.github.com/users/horowitza/gists{/gist_id}","starred_url":"https://api.github.com/users/horowitza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/horowitza/subscriptions","organizations_url":"https://api.github.com/users/horowitza/orgs","repos_url":"https://api.github.com/users/horowitza/repos","events_url":"https://api.github.com/users/horowitza/events{/privacy}","received_events_url":"https://api.github.com/users/horowitza/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-15T19:00:45Z","updated_at":"2018-03-15T19:00:45Z","closed_at":null,"author_association":"NONE","body":"In some applications, the user may need to specify the port which shinytest runs on, however shinytest uses `random_open_port()` to specify the port.\r\n\r\n```\r\n  port <- random_open_port()\r\n  if (is_rmd(path)) {\r\n    # Shiny document\r\n    rcmd <- paste0(\r\n      rcmd,\r\n      \"; options(shiny.testmode = TRUE); \",\r\n      sprintf(\"rmarkdown::run('%s', shiny_args=list(port=%d))\", path, port)\r\n    )\r\n  } else {\r\n    # Normal shiny app\r\n    rcmd <- paste0(\r\n      rcmd,\r\n      \"; options(shiny.testmode = TRUE); \",\r\n      sprintf(\"shiny::runApp('%s', port=%d)\", path, port)\r\n    )\r\n  }\r\n```\r\nhttps://github.com/rstudio/shinytest/blob/master/R/initialize.R#L101-L116"}}
{"actor":{"display_login":"horowitza"}}