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

[test-suite] Automate the initial setup for the sanity test #1431

Closed
alhambrav opened this Issue Oct 6, 2017 · 11 comments

Comments

@alhambrav
Member

alhambrav commented Oct 6, 2017

Automate the initial setup for the Sanity test:

  1. Clone craftercms and build and deploy, check that it builds and deploys without errors

Steps:
From your command line, clone craftercms

git clone https://github.com/craftercms/craftercms.git

Build and deploy craftercms

./gradlew init build deploy

The end of the output should look like this if it is successful ( we did 3 tasks: init, build, deploy):

BUILD SUCCESSFUL in 5m 50s
3 actionable tasks: 3 executed
  1. Start craftercms, both authoring and delivery, check that it's able to start both the authoring and delivery

In your command line, type the following to start both the authoring and delivery:

./gradlew start

The output should look something like this if it is successful:

➜  craftercms git:(master) ./gradlew start

 ██████╗ ██████╗   █████╗  ███████╗ ████████╗ ███████╗ ██████╗      ██████╗ ███╗   ███╗ ███████╗
██╔════╝ ██╔══██╗ ██╔══██╗ ██╔════╝ ╚══██╔══╝ ██╔════╝ ██╔══██╗    ██╔════╝ ████╗ ████║ ██╔════╝
██║      ██████╔╝ ███████║ █████╗      ██║    █████╗   ██████╔╝    ██║      ██╔████╔██║ ███████╗
██║      ██╔══██╗ ██╔══██║ ██╔══╝      ██║    ██╔══╝   ██╔══██╗    ██║      ██║╚██╔╝██║ ╚════██║
╚██████╗ ██║  ██║ ██║  ██║ ██║         ██║    ███████╗ ██║  ██║    ╚██████╗ ██║ ╚═╝ ██║ ███████║
 ╚═════╝ ╚═╝  ╚═╝ ╚═╝  ╚═╝ ╚═╝         ╚═╝    ╚══════╝ ╚═╝  ╚═╝     ╚═════╝ ╚═╝     ╚═╝ ╚══════╝

------------------------------------------------------------
Starting Deployer
------------------------------------------------------------
------------------------------------------------------------
Starting Solr
------------------------------------------------------------
Waiting up to 180 seconds to see Solr running on port 8694
 [|]

 [/]

 [-]

 [\]

Started Solr server on port 8694 (pid=5923). Happy searching!



> Task :start
Running for the first time might take longer while fetching OS dependent requirements.


------------------------------------------------------------
Starting Tomcat
------------------------------------------------------------
Tomcat started.
> :start
Log files live here: "/Users/vita/temp/test2/craftercms/crafter-authoring/logs/".
To follow the main tomcat log, you can "tail -f /Users/vita/temp/test2/craftercms/crafter-authoring/logs/tomcat/catalina.out"

Happy Crafting

 ██████╗ ██████╗   █████╗  ███████╗ ████████╗ ███████╗ ██████╗      ██████╗ ███╗   ███╗ ███████╗
██╔════╝ ██╔══██╗ ██╔══██╗ ██╔════╝ ╚══██╔══╝ ██╔════╝ ██╔══██╗    ██╔════╝ ████╗ ████║ ██╔════╝
██║      ██████╔╝ ███████║ █████╗      ██║    █████╗   ██████╔╝    ██║      ██╔████╔██║ ███████╗
██║      ██╔══██╗ ██╔══██║ ██╔══╝      ██║    ██╔══╝   ██╔══██╗    ██║      ██║╚██╔╝██║ ╚════██║
╚██████╗ ██║  ██║ ██║  ██║ ██║         ██║    ███████╗ ██║  ██║    ╚██████╗ ██║ ╚═╝ ██║ ███████║
 ╚═════╝ ╚═╝  ╚═╝ ╚═╝  ╚═╝ ╚═╝         ╚═╝    ╚══════╝ ╚═╝  ╚═╝     ╚═════╝ ╚═╝     ╚═╝ ╚══════╝

------------------------------------------------------------
Starting Deployer
------------------------------------------------------------
------------------------------------------------------------
Starting Solr
------------------------------------------------------------
Waiting up to 180 seconds to see Solr running on port 8695
 [|]

 [/]

 [-]

 [\]

 [|]

 [/]

 [-]

Started Solr server on port 8695 (pid=6067). Happy searching!



------------------------------------------------------------
Starting Tomcat
------------------------------------------------------------
Tomcat started.
> :start
Log files live here: "/Users/vita/temp/test2/craftercms/crafter-delivery/logs/".
To follow the main tomcat log, you can "tail -f /Users/vita/temp/test2/craftercms/crafter-delivery/logs/tomcat/catalina.out"

Happy Crafting

BUILD SUCCESSFUL in 16s
1 actionable task: 1 executed
  1. Stop craftercms, both authoring and delivery, check that it's able to stop both the authoring and delivery

In your command line, type the following to stop both the authoring and delivery:

./gradlew stop

The output should look something like this if it is successful:

➜  craftercms git:(develop) ./gradlew stop

 ██████╗ ██████╗   █████╗  ███████╗ ████████╗ ███████╗ ██████╗      ██████╗ ███╗   ███╗ ███████╗
██╔════╝ ██╔══██╗ ██╔══██╗ ██╔════╝ ╚══██╔══╝ ██╔════╝ ██╔══██╗    ██╔════╝ ████╗ ████║ ██╔════╝
██║      ██████╔╝ ███████║ █████╗      ██║    █████╗   ██████╔╝    ██║      ██╔████╔██║ ███████╗
██║      ██╔══██╗ ██╔══██║ ██╔══╝      ██║    ██╔══╝   ██╔══██╗    ██║      ██║╚██╔╝██║ ╚════██║
╚██████╗ ██║  ██║ ██║  ██║ ██║         ██║    ███████╗ ██║  ██║    ╚██████╗ ██║ ╚═╝ ██║ ███████║
 ╚═════╝ ╚═╝  ╚═╝ ╚═╝  ╚═╝ ╚═╝         ╚═╝    ╚══════╝ ╚═╝  ╚═╝     ╚═════╝ ╚═╝     ╚═╝ ╚══════╝

------------------------------------------------------------
Stopping Tomcat
------------------------------------------------------------
Tomcat stopped.
------------------------------------------------------------
Stopping Solr
------------------------------------------------------------
Sending stop command to Solr running on port 8694 ... waiting up to 180 seconds to allow Jetty process 17088 to stop gracefully.
 [|]

 [/]

 [-]

 [\]


------------------------------------------------------------
Stopping Deployer
------------------------------------------------------------

 ██████╗ ██████╗   █████╗  ███████╗ ████████╗ ███████╗ ██████╗      ██████╗ ███╗   ███╗ ███████╗
██╔════╝ ██╔══██╗ ██╔══██╗ ██╔════╝ ╚══██╔══╝ ██╔════╝ ██╔══██╗    ██╔════╝ ████╗ ████║ ██╔════╝
██║      ██████╔╝ ███████║ █████╗      ██║    █████╗   ██████╔╝    ██║      ██╔████╔██║ ███████╗
██║      ██╔══██╗ ██╔══██║ ██╔══╝      ██║    ██╔══╝   ██╔══██╗    ██║      ██║╚██╔╝██║ ╚════██║
╚██████╗ ██║  ██║ ██║  ██║ ██║         ██║    ███████╗ ██║  ██║    ╚██████╗ ██║ ╚═╝ ██║ ███████║
 ╚═════╝ ╚═╝  ╚═╝ ╚═╝  ╚═╝ ╚═╝         ╚═╝    ╚══════╝ ╚═╝  ╚═╝     ╚═════╝ ╚═╝     ╚═╝ ╚══════╝

------------------------------------------------------------
Stopping Tomcat
------------------------------------------------------------
Tomcat stopped.
------------------------------------------------------------
Stopping Solr
------------------------------------------------------------
Sending stop command to Solr running on port 8695 ... waiting up to 180 seconds to allow Jetty process 17226 to stop gracefully.
 [|]

 [/]

 [-]

 [\]


------------------------------------------------------------
Stopping Deployer
------------------------------------------------------------

BUILD SUCCESSFUL in 27s
2 actionable tasks: 2 executed
@luishernandezmonge

This comment has been minimized.

Show comment
Hide comment
@luishernandezmonge

luishernandezmonge Oct 18, 2017

Member

This can be automated it is part of the crafter installation process, the all testing framework is executed after gradlew deploy process using ./gradlew test.
Let me know if you want that I create something like a bash script for automate the process of above.

Member

luishernandezmonge commented Oct 18, 2017

This can be automated it is part of the crafter installation process, the all testing framework is executed after gradlew deploy process using ./gradlew test.
Let me know if you want that I create something like a bash script for automate the process of above.

@luishernandezmonge luishernandezmonge moved this from Backlog to Test & Validate in Crafter CMS v3.0.x Oct 18, 2017

@alhambrav

This comment has been minimized.

Show comment
Hide comment
@alhambrav

alhambrav Oct 18, 2017

Member

Yes, we'd like this automated if possible and the output checked that there are no errors. The script can then be kicked off before running the test framework. Ping me if you have any questions.

Member

alhambrav commented Oct 18, 2017

Yes, we'd like this automated if possible and the output checked that there are no errors. The script can then be kicked off before running the test framework. Ping me if you have any questions.

@alhambrav alhambrav moved this from Test & Validate to In Progress in Crafter CMS v3.0.x Oct 18, 2017

@luishernandezmonge

This comment has been minimized.

Show comment
Hide comment
@luishernandezmonge

luishernandezmonge Jan 11, 2018

Member

Done, for linux&mac scripts... working on creating the windows script.

Member

luishernandezmonge commented Jan 11, 2018

Done, for linux&mac scripts... working on creating the windows script.

@luishernandezmonge

This comment has been minimized.

Show comment
Hide comment
@luishernandezmonge

luishernandezmonge Jan 12, 2018

Member

Done, for windows scripts. @alhambrav where should I place those scripts?

Member

luishernandezmonge commented Jan 12, 2018

Done, for windows scripts. @alhambrav where should I place those scripts?

@alhambrav

This comment has been minimized.

Show comment
Hide comment
@alhambrav

alhambrav Jan 12, 2018

Member

@luishernandezmonge Hi! We should put the scripts in the test-suite, to be called from a gradle task. Here's a summary on what the gradle task should be doing:

  1. Create a temp folder inside craftercms then cd into temp
  2. start the script checking that you can git clone, build and start and stop craftercms without errors. (Please note that I added the stop craftercms, since we will be deleting the craftercms folder inside temp. I edited the ticket above, added item number 3, to stop craftercms and check there are no errors)
  3. delete the craftercms folder inside the temp folder or should we delete the temp folder @sumerjabri ?
  4. start the selenium tests for sanity test
Member

alhambrav commented Jan 12, 2018

@luishernandezmonge Hi! We should put the scripts in the test-suite, to be called from a gradle task. Here's a summary on what the gradle task should be doing:

  1. Create a temp folder inside craftercms then cd into temp
  2. start the script checking that you can git clone, build and start and stop craftercms without errors. (Please note that I added the stop craftercms, since we will be deleting the craftercms folder inside temp. I edited the ticket above, added item number 3, to stop craftercms and check there are no errors)
  3. delete the craftercms folder inside the temp folder or should we delete the temp folder @sumerjabri ?
  4. start the selenium tests for sanity test
@luishernandezmonge

This comment has been minimized.

Show comment
Hide comment
Member

luishernandezmonge commented Jan 15, 2018

@luishernandezmonge luishernandezmonge moved this from In Progress to Test & Validate in Crafter CMS v3.0.x Jan 15, 2018

@luishernandezmonge luishernandezmonge removed their assignment Jan 15, 2018

@luishernandezmonge

This comment has been minimized.

Show comment
Hide comment
@luishernandezmonge

luishernandezmonge Jan 15, 2018

Member

Changes on the next PR: craftercms/test-suite#252
Please, validate after merge

Member

luishernandezmonge commented Jan 15, 2018

Changes on the next PR: craftercms/test-suite#252
Please, validate after merge

@alhambrav

This comment has been minimized.

Show comment
Hide comment
@alhambrav

alhambrav Jan 22, 2018

Member

@luishernandezmonge
I tested the script in OS X and there's an error when stopping craftercms. I think it's because the startup is not yet done when the stop command is sent. We may have to wait in the script to let the startup finish, or maybe, look in the tomcat log for the text similar to: 22-Jan-2018 09:29:58.524 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 52276 ms

Here's a snippet of the error:
https://gist.github.com/alhambrav/13f9d71eface2d3520c4a4c1525c93ed

Member

alhambrav commented Jan 22, 2018

@luishernandezmonge
I tested the script in OS X and there's an error when stopping craftercms. I think it's because the startup is not yet done when the stop command is sent. We may have to wait in the script to let the startup finish, or maybe, look in the tomcat log for the text similar to: 22-Jan-2018 09:29:58.524 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 52276 ms

Here's a snippet of the error:
https://gist.github.com/alhambrav/13f9d71eface2d3520c4a4c1525c93ed

@luishernandezmonge

This comment has been minimized.

Show comment
Hide comment
@luishernandezmonge

luishernandezmonge Jan 22, 2018

Member

@alhambrav added wait condition for a couple of minutes until server is totally (also totally down), and checking some listening conditions.
PR: craftercms/test-suite#266
Please, test those and let me know your feedback.

Member

luishernandezmonge commented Jan 22, 2018

@alhambrav added wait condition for a couple of minutes until server is totally (also totally down), and checking some listening conditions.
PR: craftercms/test-suite#266
Please, test those and let me know your feedback.

@alhambrav

This comment has been minimized.

Show comment
Hide comment
@alhambrav

alhambrav Jan 23, 2018

Member

@luishernandezmonge The script is okay now (no errors when stop command is sent). Will wait for the gradle task to be done before closing this ticket.

Member

alhambrav commented Jan 23, 2018

@luishernandezmonge The script is okay now (no errors when stop command is sent). Will wait for the gradle task to be done before closing this ticket.

@alhambrav

This comment has been minimized.

Show comment
Hide comment
@alhambrav

alhambrav Feb 14, 2018

Member

Verified.

Member

alhambrav commented Feb 14, 2018

Verified.

@alhambrav alhambrav closed this Feb 14, 2018

Crafter CMS v3.0.x automation moved this from Test & Validate to Completed Feb 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment