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

moduleServer/testServer overhaul #2807

Merged
merged 39 commits into from Apr 8, 2020
Merged

moduleServer/testServer overhaul #2807

merged 39 commits into from Apr 8, 2020

Conversation

@alandipert
Copy link
Contributor

@alandipert alandipert commented Mar 31, 2020

This PR aligns the feature formerly known as "integration testing" with the new moduleServer() function and usage patterns.

Changes

Previously, the integration testing feature consisted of two entrypoints: testModule() and testServer(). Now, there's only one entrypoint, testServer(). testServer() can be used to test either the server functions in established Shiny apps, or module functions.

In addition to the consolidation of these functions, there is a slight semantic change corresponding to the change in definition of a Shiny module. Previously, the environment captured from within module functions was used to mask the surrounding dynamic environment of the testServer(). The combination of the module's dynamic environment mask and the environment surrounding the call to testServer() defined the environment in which the expr argument to testServer() was evaluated.

Now, because "new-style" modules involve at least two functions -- and two environments of interest, with respect to testing -- these two function environments are combined, with the inner-most environment taking precedence. The new semantics are demonstrated in tests/testthat/test-test-server-scope.R.

schloerke and others added 15 commits Mar 12, 2020
@alandipert alandipert changed the title moduleServer overhaul moduleServer testServer overhaul Mar 31, 2020
R/test-server.R Outdated Show resolved Hide resolved
alandipert added 3 commits Mar 31, 2020
@alandipert alandipert mentioned this pull request Apr 1, 2020
@alandipert alandipert changed the title moduleServer testServer overhaul moduleServer/testServer overhaul Apr 1, 2020
alandipert added 2 commits Apr 1, 2020
@alandipert alandipert requested a review from wch Apr 1, 2020
@alandipert alandipert marked this pull request as ready for review Apr 1, 2020
R/test-server.R Outdated Show resolved Hide resolved
R/test-server.R Outdated Show resolved Hide resolved
alandipert added 9 commits Apr 2, 2020
R/mock-session.R Outdated Show resolved Hide resolved
R/mock-session.R Outdated Show resolved Hide resolved
R/mock-session.R Outdated Show resolved Hide resolved
R/mock-session.R Outdated Show resolved Hide resolved
R/test-server.R Outdated Show resolved Hide resolved
tests/testthat/test-test-server-app.R Show resolved Hide resolved
tests/testthat/test-test-server-scope.R Outdated Show resolved Hide resolved
tests/testthat/test-test-server-scope.R Outdated Show resolved Hide resolved
tests/testthat/test-test-server.R Outdated Show resolved Hide resolved
tests/testthat/test-test-server-scope.R Outdated Show resolved Hide resolved
@wch wch self-requested a review Apr 8, 2020
@wch
wch approved these changes Apr 8, 2020
@wch wch merged commit b709b53 into master Apr 8, 2020
3 of 5 checks passed
3 of 5 checks passed
continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/travis-ci/push The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla Contributor License Agreement is signed.
Details
@wch wch deleted the serverModule-testModule branch Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.