ITB 2023 Creating and managing a QA focused production-replicating environment for complex sites_Dan Card.pdf
ortussolutions
28 views
22 slides
Sep 11, 2024
Slide 1 of 22
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
About This Presentation
Modern web applications involve complex components and technologies. This session explores an Ortus Team's QA environment creation, featuring multiple APIs, databases, and monitoring tools. The setup uses Linux, Docker, and CommandBox for easy management and branch testing. While not hands-on, t...
Modern web applications involve complex components and technologies. This session explores an Ortus Team's QA environment creation, featuring multiple APIs, databases, and monitoring tools. The setup uses Linux, Docker, and CommandBox for easy management and branch testing. While not hands-on, the overview aims to demystify these technologies and show their value in creating a productive team tool.
Size: 1.13 MB
Language: en
Added: Sep 11, 2024
Slides: 22 pages
Slide Content
Session
SESSION
Case Study: Creating and Managing a QA
Feature Testing Environment
LED BY
Dan Card
Dan Card
SPEAKER AT ITB2023
Dan Card is a Senior Developer at Ortus Solutions who find pictures of
people with their chin in their hands somewhat pretentious
•Lives just north of Boston
•Has been using CF since around
2004
•Has developed a love of testing
over the past several years
•Sometimes uses frozen Zoom
pictures as headshots
The Goal
We needed an actual formal testing environment
The triggering event was a module using the Adobe Generate Document PDF API. All the tests were passing locally,
everything worked in staging, it had passed QA and then blew up in production. Why?
Local was Windows. Staging was Windows. Production was Linux and the issue was in the direction of the slashes in
our file names. Easily fixed but you never know the other stupid stuff that’s going to trip you up.
The Goal
•Replicate Production as closely as possible
•Be easy to manage or no one would use it
•Pull any branch from any repo to test before things got into
Dev let alone production
•Be entirely self contained
•Rather than risk “merge issues” and ensure a clean test, we
wanted to completely delete the existing files and re-clone
•Able to be blown away and recreated
We needed something which…
The Solution
•Linux Box
•Not on our local system
•Because of the Multi Sites it seemed to be a good use
for Docker
•I didn’t know Linux ( still mostly don’t )
•Wasn’t budgeted
•I had tried to learn Docker several times and it never
“stuck”
•Not too great at git
And The Problems
The Ecosystem
•A React Front end
•A ColdboxAPI (with Fusion Reactor)
•MSSQL
There are a number of components to the entire system:
What are we creating: High Level
React
ColdBoxAPI
MSSQL Server
What are we creating: Detail
Front End
(JS, React)
name: ninja_app
CommandBox
/ninjaapp
80
API
( Coldbox, Lucee,
Fusion-Reactor )
name: api
MSSQL
name: mssql
Playwright
( JS )
name: playwright
Monitoring Software
( ColdBox, Lucee)
name: siteModel
Containers:
Storage:
Ports:
/api /dataFolder /backupFolder /playwright /siteModel
8081 8082 8083 80841434
Apps / Files / Modules:
Module:
ecoSystemTesting
File: docker-compose.ymlDocker
/build/envFiles
3 Phases
1.Create and prep the Linux Boxes
2.Create the folder / containers
3.Getting Files and databases onto the Linux box.
Steps to Create: Linux Box
Phase 1: Create the Linux Box
1.Spin up instance on AWS
2.Connect to Instance
3.System Updates
4.Set the version of Java to use
5.Install Git – if needed
6.Install Node
7.Install Yarn
8.Install Docker / Docker Compose
9.Install CommandBox
10.Install ecosystemTestingModule
11.Permissions for scripts
12.Firewall permissions in the AWS security group
At The End Of Step 1: The Linux Box
CommandBoxApps / Files / Modules:
Docker
4 Phases
1.Create and prep the Linux Boxes
2.Create the folder / containers
3.Use the ecosystemTesting module to handle the actual cloning of the sites.
4.Demo it
To the containers!
Steps
Create The Folders and Containers
•Create our folders
•Create the docker-compose file which defined our containers
•CommandBox
•Node / React
•MSSQL
•Create Dockerfilesand additional scripts for the more elaborate installs for MSSQL and JS
•Learn the difference between Start / Build / Stop / Restart / Up
At The End of Step 2: Our Containers
Front End
(JS, React)
name: ninja_app
CommandBox
/ninjaapp
80
API
( Coldbox, Lucee,
Fusion-Reactor )
name: api
MSSQL
name: mssql
Playwright
( JS )
name: playwright
Monitoring Software
( ColdBox, Lucee)
name: siteModel
Containers:
Storage:
Ports:
/api /dataFolder /backupFolder /playwright /siteModel
8081 8082 8083 80841434
Apps / Files / Modules:
Module:
ecoSystemTesting
File: docker-compose.ymlDocker
/build
4 Phases
1.Create and prep the Linux Boxes
2.Create the folder / containers
3.Use the ecosystemTesting module to handle the actual cloning of the sites.
4.Demo it
However, we have no files or content yet!
How Do We Get The Site Files onto the Server?
Create The Folders and Containers
Our Testing instance
ecosystemTesting
module
Basic Steps
Get the content!
•Configure each site 1x
•Source (githubetc)
•Username and tokens (remains in the CommandBoxconfig, not in a repo)
•URLs / Folders
•Environment Docs –i.e. .cfconfigand .env files
•At Run Time
•What branch?
•Evergreen?
How Do We Get DB / Schema onto the Server?
Create The Folders and Containers
ecosystemTesting
module
MSSQL
Container
Migrations
QB Schema
Manual Restore
Schema
Schema and Data
Configuring The Ecosystem Tool: Project
Get the content!
•`ecosystemTestingconfigure`
•Project name
•Root Folder
•Source of repos
•Repo login name
•Repo Token
Configuring The Ecosystem Tool: Site
Get the content!
•Essential Items
•Site name
•Repo location (github / git lab)
•Parent branch
•Name of the folder (relative to root of project)
•url
•Port
•Comma delimited list of Files to copy -source:target,source:target
•Comma delimited scripts to run (from CommandBox)
•Name of the Docker container
Refreshing the Ecosystem
Get the content!
•`ecosystemTestingrefreshEcoSystemninja 1 true`
•`!docker-compose restart` Restarts everything but the jssites will fail
•`!docker-compose up –d` Rebuilds the JS sites and starts them