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

Create an E2E testing environment to enable more complex testing scenarios #2197

Closed
bsacharski opened this issue Oct 11, 2020 · 0 comments · Fixed by #2198
Closed

Create an E2E testing environment to enable more complex testing scenarios #2197

bsacharski opened this issue Oct 11, 2020 · 0 comments · Fixed by #2198
Assignees
Labels

Comments

@bsacharski
Copy link
Contributor

We should create an end-to-end testing environment that could be used to test more complex scenarios, that the unit tests cannot verify.

E2E testing environment should be easy to set up and should allow to test real-life scenarios, so it should incorporate SSH, HTTP server and so on.

bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 11, 2020
Created docker-based end-to-end testing environment, which allows
for testing more complex scenarios.

Additionally added FunctionE2ETest class that contains test scenario
for `run` function with placeholders.

Closes deployphp#2197
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 13, 2020
Created docker-based end-to-end testing environment, which allows
for testing more complex scenarios.

Additionally added FunctionE2ETest class that contains test scenario
for `run` function with placeholders.

Closes deployphp#2197
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 13, 2020
…unit-tests

The docker directory has been moved into test/ directory.
Additionally the e2e tests have been separated from the unit-test
files:
  * AbstractE2ETest class is directly inheriting from TestCase,
    dropping relation to the AbstractTest
  * Separate bootstrap.php file for e2e test was created
  * Separate phpunit-e2e.xml.dist file was created to configure
    PHPUnit for just the e2e tests
  * deployer docker service now runs only e2e tests by default
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 13, 2020
Added E2E tests steps to GH actions:
* building the docker-compose stack (building images)
* starting the stack to run the tests

If E2E tests fail, then docker-compose up will end with non-zero
exit code, thus the workflow will be marked as failed.
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 15, 2020
Created docker-based end-to-end testing environment, which allows
for testing more complex scenarios.

Additionally added FunctionE2ETest class that contains test scenario
for `run` function with placeholders.

Closes deployphp#2197
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 15, 2020
…unit-tests

The docker directory has been moved into test/ directory.
Additionally the e2e tests have been separated from the unit-test
files:
  * AbstractE2ETest class is directly inheriting from TestCase,
    dropping relation to the AbstractTest
  * Separate bootstrap.php file for e2e test was created
  * Separate phpunit-e2e.xml.dist file was created to configure
    PHPUnit for just the e2e tests
  * deployer docker service now runs only e2e tests by default
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 15, 2020
Added E2E tests steps to GH actions:
* building the docker-compose stack (building images)
* starting the stack to run the tests

If E2E tests fail, then docker-compose up will end with non-zero
exit code, thus the workflow will be marked as failed.
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 15, 2020
Fixed a discrepancy in the `run()` function, where there would be
no output when the command was being executed with a sudo.
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 15, 2020
Added two testcases for e2e tests, that verify:
* that sudo command can be ran with password provided interactively
* that sudo command can be ran with password passed via argument

To allow for these tests to happen, the Dockerfile for server
service had to be modified - the deployer user will require a
password, when running command with sudo.
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 18, 2020
Created docker-based end-to-end testing environment, which allows
for testing more complex scenarios.

Additionally added FunctionE2ETest class that contains test scenario
for `run` function with placeholders.

Closes deployphp#2197
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 18, 2020
…unit-tests

The docker directory has been moved into test/ directory.
Additionally the e2e tests have been separated from the unit-test
files:
  * AbstractE2ETest class is directly inheriting from TestCase,
    dropping relation to the AbstractTest
  * Separate bootstrap.php file for e2e test was created
  * Separate phpunit-e2e.xml.dist file was created to configure
    PHPUnit for just the e2e tests
  * deployer docker service now runs only e2e tests by default
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 18, 2020
Added E2E tests steps to GH actions:
* building the docker-compose stack (building images)
* starting the stack to run the tests

If E2E tests fail, then docker-compose up will end with non-zero
exit code, thus the workflow will be marked as failed.
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 18, 2020
Fixed a discrepancy in the `run()` function, where there would be
no output when the command was being executed with a sudo.
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 18, 2020
Added two testcases for e2e tests, that verify:
* that sudo command can be ran with password provided interactively
* that sudo command can be ran with password passed via argument

To allow for these tests to happen, the Dockerfile for server
service had to be modified - the deployer user will require a
password, when running command with sudo.
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 18, 2020
Added a very simple E2E test that checks whether the Laravel-boilerplate
deploys successfully to the testing server.

The testing scenario will deploy the app, copy sample .env file,
generate the app key and finally try to get the main page contents
to verify that the expected string is visible in the page source.
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 18, 2020
Added a very simple E2E test that checks whether the Laravel-boilerplate
deploys successfully to the testing server.

The testing scenario will deploy the app, copy sample .env file,
generate the app key and finally try to get the main page contents
to verify that the expected string is visible in the page source.
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 19, 2020
Moved E2E tests to separate job and added docker-compose cache
to slightly improve stack build times.
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 19, 2020
Updated the laravel-boilerplate deploy config to use the repository
that belongs to deployphp organization.
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 19, 2020
Updated the laravel-boilerplate deploy config to use the repository
that belongs to deployphp organization.
antonmedv pushed a commit that referenced this issue Oct 19, 2020
* [#2197] Created E2E testing environment

Created docker-based end-to-end testing environment, which allows
for testing more complex scenarios.

Additionally added FunctionE2ETest class that contains test scenario
for `run` function with placeholders.

Closes #2197

* [#2197] Moved docker to test dir & separated e2e tests from unit-tests

The docker directory has been moved into test/ directory.
Additionally the e2e tests have been separated from the unit-test
files:
  * AbstractE2ETest class is directly inheriting from TestCase,
    dropping relation to the AbstractTest
  * Separate bootstrap.php file for e2e test was created
  * Separate phpunit-e2e.xml.dist file was created to configure
    PHPUnit for just the e2e tests
  * deployer docker service now runs only e2e tests by default

* [#2197] Added E2E tests to GH actions

Added E2E tests steps to GH actions:
* building the docker-compose stack (building images)
* starting the stack to run the tests

If E2E tests fail, then docker-compose up will end with non-zero
exit code, thus the workflow will be marked as failed.

* [#2197] Fixed no output when using run() with sudo

Fixed a discrepancy in the `run()` function, where there would be
no output when the command was being executed with a sudo.

* [#2197] Added testcases for running commands with sudo

Added two testcases for e2e tests, that verify:
* that sudo command can be ran with password provided interactively
* that sudo command can be ran with password passed via argument

To allow for these tests to happen, the Dockerfile for server
service had to be modified - the deployer user will require a
password, when running command with sudo.

* [#2197] Added Laravel-boilerplate deploy E2E test

Added a very simple E2E test that checks whether the Laravel-boilerplate
deploys successfully to the testing server.

The testing scenario will deploy the app, copy sample .env file,
generate the app key and finally try to get the main page contents
to verify that the expected string is visible in the page source.

* [#2197] Moved E2E tests to separate job

Moved E2E tests to separate job and added docker-compose cache
to slightly improve stack build times.

* [#2197] Using deployphp test-laravel repo for E2E tests

Updated the laravel-boilerplate deploy config to use the repository
that belongs to deployphp organization.

Co-authored-by: Bartlomiej Sacharski <[email protected]>
bsacharski pushed a commit to bsacharski/deployer that referenced this issue Oct 25, 2020
antonmedv pushed a commit that referenced this issue Oct 25, 2020
* [#2187] Type declarations in src/Collection

Added type declarations for methods in `src/Collection`

* [#2187] Missing type declaration in src/Configuration

Added missing type declaration is `src/Configuration/Configuration.php`

* [#2187] Removed unnecessary return in \Deployer\Collection\Collection::get

Removed the return which would result in returning void in the
\Deployer\Collection\Collection::get method

Updated phpdoc to reflect this change

* [#2197] Removed "@phpcsSuppress" annotations from \Deployer\Collection\Collection

Co-authored-by: Bartlomiej Sacharski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants