render creates a static document i.e. not a running shiny app. You need to use rmarkdown::run("test.Rmd").
render
rmarkdown::run("test.Rmd")