SlideShare a Scribd company logo
Benjamin Bischo
ff
| @bischo
ff
dev | softwaretester.blog
Simplifying your test runs with „Make“
TestMμ Conference 2022
Benjamin Bischo
ff
• Test Automation Engineer
• 7 years of SDET experience
• ~ 22 years in IT overall
• 6 years at trivago N.V.
About me
@bischo
ff
dev
Credits
“Make
fi
les in 2019 - Why They Still Matter”
Simon Brüggen
trivago Tech Blog
2019
“Das nützlich-unbedenklich Spektrum”
(“The useful harmless spectrum“)
Felix von Leitner,
2019
@bischo
ff
dev
The Prologue
@bischo
ff
dev
„Architect of destruction“
Barney Stinson:
“I’m gonna give you four words to live by:
new is always better! [...]”
Ted Mosby:
“And this theory applies to everything?”
Barney Stinson:
“Everything.”
@bischo
ff
dev
Is new always better?
@bischo
ff
dev
Developers
love new things.
@bischo
ff
dev
Learning new
things is crucial.
@bischo
ff
dev
The "New is always better" dilemma
• Familiarity
Getting comfortable with new solutions takes time.
• Maturity
New software can have
fl
aws and unwanted dependencies.
• Management
Management may view a proof of concept as close to
fi
nal.
• Tractor Factor
A single developer can be the only one in the know.
@bischo
ff
dev
If you learn a new tool,
you want to use it.
@bischo
ff
dev
The Psychology of Science, Abraham Maslow, 1966
„[...] I suppose it is tempting, if the only tool you
have is a hammer, to treat everything as if it were a
nail.“
@bischo
ff
dev
What is Make?
@bischo
ff
dev
Make (software), Wikipedia
„[...] Make is applicable to any process that involves
executing arbitrary commands to transform a
source file to a target result.“
@bischo
ff
dev
Make
A few facts
• Invented by Stuart Feldman in 1976 at Bell Labs
• Initially a build automation tool for executable programs
• Built natively into Unix, Linux, MacOS
• Windows: Chocolatey, Cygwin, Make for Windows or WSL
@bischo
ff
dev
Make
Cons
• Can be hard to master
• Dependent on tabs and spaces
• Bugs can be tricky to
fi
gure out
@bischo
ff
dev
Make
Pros
• Basically available everywhere
• Proven solution
• Consistent across local and CI builds
• Easy to learn
• Very
fl
exible
• Never out of sync with documentation
@bischo
ff
dev
Parts of a Makefile
@bischo
ff
dev
Makefile
Naming and invocation
• make is the name of the tool
• It looks for make
fi
le or Make
fi
le to run
• It returns a status of 0 if successful
make [ -f makefile ] [ options ] … [ targets ] ...
@bischo
ff
dev
Makefile
Rules
• A make rule typically creates (and checks) a target
fi
le
• It is mostly dependent on timestamps
• It can also be the name of an action without a target
fi
le
@bischo
ff
dev
Makefile
Recipes
• A recipe is an action that make invokes
• Can be one or multiple commands
• Careful: each line has to be started with a tab!
@bischo
ff
dev
Makefile
Rule & Recipe
dependency.txt:
@echo "Hello world" > dependency.txt
@echo "File created"
@bischo
ff
dev
The Prerequisites
@bischo
ff
dev
Makefile
Prerequisites
final.txt: dependency.txt
echo "This is the final file!" > final.txt
cat dependency.txt >> final.txt
dependency.txt:
echo "Hello world" > dependency.txt
@bischo
ff
dev
This sounds .Phony
@bischo
ff
dev
Makefile
.Phony
final.txt: dependency.txt
echo "This is the final file!" > final.txt
cat dependency.txt >> final.txt
dependency.txt:
echo "Hello world" > dependency.txt
@bischo
ff
dev
Makefile
.Phony
final.txt: dependency.txt
echo "This is the final file!" > final.txt
cat dependency.txt >> final.txt
dependency.txt: clean
echo "Hello world" > dependency.txt
clean:
rm -f dependency.txt
rm -f final.txt
@bischo
ff
dev
Makefile
.Phony
final.txt: dependency.txt
echo "This is the final file!" > final.txt
cat dependency.txt >> final.txt
dependency.txt: clean
echo "Hello world" > dependency.txt
.PHONY: clean
clean:
rm -f dependency.txt
rm -f final.txt
@bischo
ff
dev
When does it build what?
@bischo
ff
dev
Makefile
Build order
clean:
@echo "Clean up old files"
build: clean
@echo "Build application"
deploy: build
@echo "Deploy application to stage server"
test: deploy
@echo "Test stage deployment"
.PHONY: clean build deploy test
@bischo
ff
dev
Makefile
Build order
clean:
@echo "Clean up old files"
build: clean
@echo "Build application"
deploy: build
@echo "Deploy application to stage server"
test: deploy
@echo "Test stage deployment"
.PHONY: clean build deploy test
@bischo
ff
dev
Makefile
Build order
clean:
@echo "Clean up old files"
build: clean
@echo "Build application"
deploy: build
@echo "Deploy application to stage server"
test: deploy
@echo "Test stage deployment"
.PHONY: clean build deploy test
@bischo
ff
dev
Makefile
Build order
test: deploy
@echo "Test stage deployment"
deploy: build
@echo "Deploy application to stage server"
build: clean
@echo "Build application"
clean:
@echo "Clean up old files"
.PHONY: clean build deploy test
@bischo
ff
dev
Makefile
Build order
test: deploy
@echo "Test stage deployment"
deploy: build
@echo "Deploy application to stage server"
build: clean
@echo "Build application"
clean:
@echo "Clean up old files"
.PHONY: clean build deploy test
@bischo
ff
dev
Makefile
Build order
test: deploy
@echo "Test stage deployment"
deploy: build
@echo "Deploy application to stage server"
build: clean
@echo "Build application"
clean:
@echo "Clean up old files"
.PHONY: clean build deploy test
@bischo
ff
dev
Makefile
Build order
test: deploy
@echo "Test stage deployment"
deploy: build
@echo "Deploy application to stage server"
build: clean
@echo "Build application"
clean:
@echo "Clean up old files"
.PHONY: clean build deploy test
@bischo
ff
dev
Makefile
Build order
test: deploy
@echo "Test stage deployment"
deploy: build
@echo "Deploy application to stage server"
build: clean
@echo "Build application"
clean:
@echo "Clean up old files"
.PHONY: clean build deploy test
@bischo
ff
dev
What about parameters?
@bischo
ff
dev
Makefile
Parameters
BROWSER ?= firefox
test:
@echo "Testing with browser ${BROWSER}"
.PHONY: deploy test
@bischo
ff
dev
Just help yourself!
@bischo
ff
dev
Makefile
Tip: help
# Show this help.
help:
@awk '/^#/{c=substr($$0,3);next}c&&/^[[:alpha:]]
[[:alnum:]_-]+:/{print substr($$1,1,index($
$1,":")),c}1{c=0}' $(MAKEFILE_LIST) | column -s: -t
# Test project.
test:
@echo "This would start a test"
.PHONY: help test
@bischo
ff
dev
Makefile
Example code
https://github.com/bischo
ff
dev/make_examples
@bischo
ff
dev
This is not too complex
@bischo
ff
dev
Stuart Feldman, „The Art of Unix Programming“, Eric S. Raymond, 2003
„[...] Makefiles were text files, not magically encoded
binaries, because that was the Unix ethos:
printable, debuggable, understandable stuff.“
@bischo
ff
dev
Limitation as an
advantage
@bischo
ff
dev
Real world example
Selenium tests with Maven invocation
mvn verify -e -B -DargLine=-Dfile.encoding=UTF-8 -Dproject=„${PROJECT_NAME}”
-Dwebdriver.driver="${browserName}” -Dwebdriver.driver.version="${browserVersion}”
-Dtrupi.browser.resolution="${BROWSER_RESOLUTION}" -Dwebdriver.base.url="${BASE_URL}"
-Dtrupi.feature="${FEATURES}" -Dcustom.activated.ctests=„${CTESTS}" -Dwebdriver.hub.url="${HUB_URL}"
-Dparallel.fork.count=„${PARALLEL_RUNS}" -Dcucable.test.runs.count="${TEST_RUNS}"
-Dinclude.scenario.tags=„${INCLUDE_TAGS}" -Dtrupi.restart.browser="${RESTART_BROWSER}"
-Dtrupi.webdriver.wait=„${WEBDRIVER_WAIT}" -Dtrupi.pageload.wait="${PAGELOAD_WAIT}"
-Dtrupi.pageload.retries="${PAGELOAD_RETRIES}" -Dtrupi.kafka.enabled="${KAFKA_LOGGING_ENABLED}"
-Dtrupi.kafka.label="${KAFKA_LABEL}" -Dtrupi.logging="${LOG_MODE}"
-Dtrupi.plugin.rerun.detector.rules.file=„${RERUN_RULES_LOCATION}“ -
Dtrupi.plugin.browserstack.capabilityset.enabled=„${PLUGIN_BROWSERSTACK_ENABLED}“ -
Dtrupi.plugin.browserstack.capabilityset.browserstack.local=„${BROWSERSTACK_LOCAL}"
-Dtrupi.plugin.browserstack.capabilityset.device=„${deviceName}"
-Dtrupi.plugin.browserstack.capabilityset.realMobile="${isRealDevice}"
-Dtrupi.plugin.browserstack.capabilityset.os=„${osName}"
-Dtrupi.plugin.browserstack.capabilityset.os_version="${osVersion}"
-Dtrupi.plugin.browserstack.failurepost.enabled="${PLUGIN_BROWSERSTACK_ENABLED}"
-Dtrupi.plugin.selenoid.capabilities.enabled="${PLUGIN_SELENOID_ENABLED}"
@bischo
ff
dev
Real world example
Selenium tests with Make invocation
make test-local
BASE_URL=https://www.trivago.com
BROWSERS="chrome"
@bischo
ff
dev
Real world example
Selenium tests with Make invocation
make test-grid
BASE_URL=https://www.trivago.com
BROWSERS="chrome"
@bischo
ff
dev
Real world example
Selenium tests with Make invocation
make test-grid
BASE_URL=https://www.trivago.com
BROWSERS="chrome, firefox"
DEVICES="Samsung Galaxy"
FEATURES="src/test/resources/features/Search.feature"
@bischo
ff
dev
Real world example
Invocation in a GitHub action
- name: Run tests
id: runUiTests
working-directory: ./tests
run: >
make test-grid
BASE_URL="${{ github.event.inputs.baseUrl }}"
BROWSERS="${{ steps.setBrowser.outputs.browserString }}"
FEATURES="${{ github.event.inputs.features }}"
@bischo
ff
dev
Just a sidenote
@bischo
ff
dev
Just
A few facts
• Heavily inspired by make
• It is only a command runner (no .Phony needed)
• Runs on Linux, MacOS and Windows
• Needs to be installed on the host system/container
@bischo
ff
dev
Justfile
Rule & Recipe
myRecipe: someDependency
@echo "Hello from Just"
someDependency:
@echo "I am a dependency"
@bischo
ff
dev
The Epilogue
@bischo
ff
dev
Every project is different.
@bischo
ff
dev
Use the right tool for the job!
@bischo
ff
dev
Decouple progress
from technology!
@bischo
ff
dev
Testing is a
team effort.
@bischo
ff
dev
Listen to your
customers.
@bischo
ff
dev
Hide the
complexity!
@bischo
ff
dev
„Architect of destruction“
Barney Stinson:
“I’m gonna give you four words to live by:
new is always better! […]”
Ted Mosby:
“And this theory applies to everything?”
Barney Stinson:
“Everything.”
@bischo
ff
dev
Original version
„Architect of destruction“
Revised version
Barney Stinson:
“I’m gonna give you
fi
ve words to live by:
new is not always better! [...]”
Ted Mosby:
“I agree!”
@bischo
ff
dev
Thank you, TestMμ!
@bischo
ff
dev | softwaretester.blog

More Related Content

Similar to Simplifying your test runs with „Make“

Continuous feature-development
Continuous feature-developmentContinuous feature-development
Continuous feature-development
nhm taveer hossain khan
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
Pablo Godel
 
Csharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoCsharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoMamgmo Magnda
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)Fabien Potencier
 
When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?
Niklas Heidloff
 
[Mas 500] Software Development Strategies
[Mas 500] Software Development Strategies[Mas 500] Software Development Strategies
[Mas 500] Software Development Strategiesrahulbot
 
Lean engineering for lean/balanced teams: lessons learned (and still learning...
Lean engineering for lean/balanced teams: lessons learned (and still learning...Lean engineering for lean/balanced teams: lessons learned (and still learning...
Lean engineering for lean/balanced teams: lessons learned (and still learning...
Balanced Team
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
Dave Cross
 
Comment Asciidoctor peut vous aider pour votre doc
Comment Asciidoctor peut vous aider pour votre docComment Asciidoctor peut vous aider pour votre doc
Comment Asciidoctor peut vous aider pour votre doc
Jérémie Bresson
 
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
adamleff
 
Make an Instant Website with Webhooks
Make an Instant Website with WebhooksMake an Instant Website with Webhooks
Make an Instant Website with Webhooks
Anne Gentle
 
The Job DSL Plugin: Introduction & What’s New
The Job DSL Plugin: Introduction & What’s NewThe Job DSL Plugin: Introduction & What’s New
The Job DSL Plugin: Introduction & What’s New
Daniel Spilker
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
Steffen Gebert
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?
AFUP_Limoges
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
Steffen Gebert
 
Deploy & Continunous Integration - TDC Floripa 2015
Deploy & Continunous Integration - TDC Floripa 2015Deploy & Continunous Integration - TDC Floripa 2015
Deploy & Continunous Integration - TDC Floripa 2015
Júnior Rocha
 
DevOps at scale: A true story - WIDS2016
DevOps at scale: A true story - WIDS2016DevOps at scale: A true story - WIDS2016
DevOps at scale: A true story - WIDS2016
Davide Benvegnù
 

Similar to Simplifying your test runs with „Make“ (20)

Continuous feature-development
Continuous feature-developmentContinuous feature-development
Continuous feature-development
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
Csharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoCsharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul Yao
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
 
When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?
 
[Mas 500] Software Development Strategies
[Mas 500] Software Development Strategies[Mas 500] Software Development Strategies
[Mas 500] Software Development Strategies
 
Lean engineering for lean/balanced teams: lessons learned (and still learning...
Lean engineering for lean/balanced teams: lessons learned (and still learning...Lean engineering for lean/balanced teams: lessons learned (and still learning...
Lean engineering for lean/balanced teams: lessons learned (and still learning...
 
tut0000021-hevery
tut0000021-heverytut0000021-hevery
tut0000021-hevery
 
tut0000021-hevery
tut0000021-heverytut0000021-hevery
tut0000021-hevery
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
 
Comment Asciidoctor peut vous aider pour votre doc
Comment Asciidoctor peut vous aider pour votre docComment Asciidoctor peut vous aider pour votre doc
Comment Asciidoctor peut vous aider pour votre doc
 
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
 
Make an Instant Website with Webhooks
Make an Instant Website with WebhooksMake an Instant Website with Webhooks
Make an Instant Website with Webhooks
 
The Job DSL Plugin: Introduction & What’s New
The Job DSL Plugin: Introduction & What’s NewThe Job DSL Plugin: Introduction & What’s New
The Job DSL Plugin: Introduction & What’s New
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?Comment améliorer le quotidien des Développeurs PHP ?
Comment améliorer le quotidien des Développeurs PHP ?
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
 
CICD_1670665418.pdf
CICD_1670665418.pdfCICD_1670665418.pdf
CICD_1670665418.pdf
 
Deploy & Continunous Integration - TDC Floripa 2015
Deploy & Continunous Integration - TDC Floripa 2015Deploy & Continunous Integration - TDC Floripa 2015
Deploy & Continunous Integration - TDC Floripa 2015
 
DevOps at scale: A true story - WIDS2016
DevOps at scale: A true story - WIDS2016DevOps at scale: A true story - WIDS2016
DevOps at scale: A true story - WIDS2016
 

More from Benjamin Bischoff

Public Speaking and Procrastination
Public Speaking and ProcrastinationPublic Speaking and Procrastination
Public Speaking and Procrastination
Benjamin Bischoff
 
All about Cluecumber
All about CluecumberAll about Cluecumber
All about Cluecumber
Benjamin Bischoff
 
The Road to QA
The Road to QAThe Road to QA
The Road to QA
Benjamin Bischoff
 
Smoke tests and mirrors
Smoke tests and mirrorsSmoke tests and mirrors
Smoke tests and mirrors
Benjamin Bischoff
 
Identifying Code Smells
Identifying Code SmellsIdentifying Code Smells
Identifying Code Smells
Benjamin Bischoff
 
Of plugins and decorators - trivago's e2e test framework in the spotlight
Of plugins and decorators - trivago's e2e test framework in the spotlightOf plugins and decorators - trivago's e2e test framework in the spotlight
Of plugins and decorators - trivago's e2e test framework in the spotlight
Benjamin Bischoff
 
The Bumpy Road Towards Continuous Delivery
The Bumpy Road Towards Continuous DeliveryThe Bumpy Road Towards Continuous Delivery
The Bumpy Road Towards Continuous Delivery
Benjamin Bischoff
 

More from Benjamin Bischoff (7)

Public Speaking and Procrastination
Public Speaking and ProcrastinationPublic Speaking and Procrastination
Public Speaking and Procrastination
 
All about Cluecumber
All about CluecumberAll about Cluecumber
All about Cluecumber
 
The Road to QA
The Road to QAThe Road to QA
The Road to QA
 
Smoke tests and mirrors
Smoke tests and mirrorsSmoke tests and mirrors
Smoke tests and mirrors
 
Identifying Code Smells
Identifying Code SmellsIdentifying Code Smells
Identifying Code Smells
 
Of plugins and decorators - trivago's e2e test framework in the spotlight
Of plugins and decorators - trivago's e2e test framework in the spotlightOf plugins and decorators - trivago's e2e test framework in the spotlight
Of plugins and decorators - trivago's e2e test framework in the spotlight
 
The Bumpy Road Towards Continuous Delivery
The Bumpy Road Towards Continuous DeliveryThe Bumpy Road Towards Continuous Delivery
The Bumpy Road Towards Continuous Delivery
 

Recently uploaded

Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 

Recently uploaded (20)

Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 

Simplifying your test runs with „Make“

  • 1. Benjamin Bischo ff | @bischo ff dev | softwaretester.blog Simplifying your test runs with „Make“ TestMμ Conference 2022
  • 2. Benjamin Bischo ff • Test Automation Engineer • 7 years of SDET experience • ~ 22 years in IT overall • 6 years at trivago N.V. About me @bischo ff dev
  • 3. Credits “Make fi les in 2019 - Why They Still Matter” Simon Brüggen trivago Tech Blog 2019 “Das nützlich-unbedenklich Spektrum” (“The useful harmless spectrum“) Felix von Leitner, 2019 @bischo ff dev
  • 5. „Architect of destruction“ Barney Stinson: “I’m gonna give you four words to live by: new is always better! [...]” Ted Mosby: “And this theory applies to everything?” Barney Stinson: “Everything.” @bischo ff dev
  • 6. Is new always better? @bischo ff dev
  • 8. Learning new things is crucial. @bischo ff dev
  • 9. The "New is always better" dilemma • Familiarity Getting comfortable with new solutions takes time. • Maturity New software can have fl aws and unwanted dependencies. • Management Management may view a proof of concept as close to fi nal. • Tractor Factor A single developer can be the only one in the know. @bischo ff dev
  • 10. If you learn a new tool, you want to use it. @bischo ff dev
  • 11. The Psychology of Science, Abraham Maslow, 1966 „[...] I suppose it is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail.“ @bischo ff dev
  • 13. Make (software), Wikipedia „[...] Make is applicable to any process that involves executing arbitrary commands to transform a source file to a target result.“ @bischo ff dev
  • 14. Make A few facts • Invented by Stuart Feldman in 1976 at Bell Labs • Initially a build automation tool for executable programs • Built natively into Unix, Linux, MacOS • Windows: Chocolatey, Cygwin, Make for Windows or WSL @bischo ff dev
  • 15. Make Cons • Can be hard to master • Dependent on tabs and spaces • Bugs can be tricky to fi gure out @bischo ff dev
  • 16. Make Pros • Basically available everywhere • Proven solution • Consistent across local and CI builds • Easy to learn • Very fl exible • Never out of sync with documentation @bischo ff dev
  • 17. Parts of a Makefile @bischo ff dev
  • 18. Makefile Naming and invocation • make is the name of the tool • It looks for make fi le or Make fi le to run • It returns a status of 0 if successful make [ -f makefile ] [ options ] … [ targets ] ... @bischo ff dev
  • 19. Makefile Rules • A make rule typically creates (and checks) a target fi le • It is mostly dependent on timestamps • It can also be the name of an action without a target fi le @bischo ff dev
  • 20. Makefile Recipes • A recipe is an action that make invokes • Can be one or multiple commands • Careful: each line has to be started with a tab! @bischo ff dev
  • 21. Makefile Rule & Recipe dependency.txt: @echo "Hello world" > dependency.txt @echo "File created" @bischo ff dev
  • 23. Makefile Prerequisites final.txt: dependency.txt echo "This is the final file!" > final.txt cat dependency.txt >> final.txt dependency.txt: echo "Hello world" > dependency.txt @bischo ff dev
  • 25. Makefile .Phony final.txt: dependency.txt echo "This is the final file!" > final.txt cat dependency.txt >> final.txt dependency.txt: echo "Hello world" > dependency.txt @bischo ff dev
  • 26. Makefile .Phony final.txt: dependency.txt echo "This is the final file!" > final.txt cat dependency.txt >> final.txt dependency.txt: clean echo "Hello world" > dependency.txt clean: rm -f dependency.txt rm -f final.txt @bischo ff dev
  • 27. Makefile .Phony final.txt: dependency.txt echo "This is the final file!" > final.txt cat dependency.txt >> final.txt dependency.txt: clean echo "Hello world" > dependency.txt .PHONY: clean clean: rm -f dependency.txt rm -f final.txt @bischo ff dev
  • 28. When does it build what? @bischo ff dev
  • 29. Makefile Build order clean: @echo "Clean up old files" build: clean @echo "Build application" deploy: build @echo "Deploy application to stage server" test: deploy @echo "Test stage deployment" .PHONY: clean build deploy test @bischo ff dev
  • 30. Makefile Build order clean: @echo "Clean up old files" build: clean @echo "Build application" deploy: build @echo "Deploy application to stage server" test: deploy @echo "Test stage deployment" .PHONY: clean build deploy test @bischo ff dev
  • 31. Makefile Build order clean: @echo "Clean up old files" build: clean @echo "Build application" deploy: build @echo "Deploy application to stage server" test: deploy @echo "Test stage deployment" .PHONY: clean build deploy test @bischo ff dev
  • 32. Makefile Build order test: deploy @echo "Test stage deployment" deploy: build @echo "Deploy application to stage server" build: clean @echo "Build application" clean: @echo "Clean up old files" .PHONY: clean build deploy test @bischo ff dev
  • 33. Makefile Build order test: deploy @echo "Test stage deployment" deploy: build @echo "Deploy application to stage server" build: clean @echo "Build application" clean: @echo "Clean up old files" .PHONY: clean build deploy test @bischo ff dev
  • 34. Makefile Build order test: deploy @echo "Test stage deployment" deploy: build @echo "Deploy application to stage server" build: clean @echo "Build application" clean: @echo "Clean up old files" .PHONY: clean build deploy test @bischo ff dev
  • 35. Makefile Build order test: deploy @echo "Test stage deployment" deploy: build @echo "Deploy application to stage server" build: clean @echo "Build application" clean: @echo "Clean up old files" .PHONY: clean build deploy test @bischo ff dev
  • 36. Makefile Build order test: deploy @echo "Test stage deployment" deploy: build @echo "Deploy application to stage server" build: clean @echo "Build application" clean: @echo "Clean up old files" .PHONY: clean build deploy test @bischo ff dev
  • 38. Makefile Parameters BROWSER ?= firefox test: @echo "Testing with browser ${BROWSER}" .PHONY: deploy test @bischo ff dev
  • 40. Makefile Tip: help # Show this help. help: @awk '/^#/{c=substr($$0,3);next}c&&/^[[:alpha:]] [[:alnum:]_-]+:/{print substr($$1,1,index($ $1,":")),c}1{c=0}' $(MAKEFILE_LIST) | column -s: -t # Test project. test: @echo "This would start a test" .PHONY: help test @bischo ff dev
  • 42. This is not too complex @bischo ff dev
  • 43. Stuart Feldman, „The Art of Unix Programming“, Eric S. Raymond, 2003 „[...] Makefiles were text files, not magically encoded binaries, because that was the Unix ethos: printable, debuggable, understandable stuff.“ @bischo ff dev
  • 45. Real world example Selenium tests with Maven invocation mvn verify -e -B -DargLine=-Dfile.encoding=UTF-8 -Dproject=„${PROJECT_NAME}” -Dwebdriver.driver="${browserName}” -Dwebdriver.driver.version="${browserVersion}” -Dtrupi.browser.resolution="${BROWSER_RESOLUTION}" -Dwebdriver.base.url="${BASE_URL}" -Dtrupi.feature="${FEATURES}" -Dcustom.activated.ctests=„${CTESTS}" -Dwebdriver.hub.url="${HUB_URL}" -Dparallel.fork.count=„${PARALLEL_RUNS}" -Dcucable.test.runs.count="${TEST_RUNS}" -Dinclude.scenario.tags=„${INCLUDE_TAGS}" -Dtrupi.restart.browser="${RESTART_BROWSER}" -Dtrupi.webdriver.wait=„${WEBDRIVER_WAIT}" -Dtrupi.pageload.wait="${PAGELOAD_WAIT}" -Dtrupi.pageload.retries="${PAGELOAD_RETRIES}" -Dtrupi.kafka.enabled="${KAFKA_LOGGING_ENABLED}" -Dtrupi.kafka.label="${KAFKA_LABEL}" -Dtrupi.logging="${LOG_MODE}" -Dtrupi.plugin.rerun.detector.rules.file=„${RERUN_RULES_LOCATION}“ - Dtrupi.plugin.browserstack.capabilityset.enabled=„${PLUGIN_BROWSERSTACK_ENABLED}“ - Dtrupi.plugin.browserstack.capabilityset.browserstack.local=„${BROWSERSTACK_LOCAL}" -Dtrupi.plugin.browserstack.capabilityset.device=„${deviceName}" -Dtrupi.plugin.browserstack.capabilityset.realMobile="${isRealDevice}" -Dtrupi.plugin.browserstack.capabilityset.os=„${osName}" -Dtrupi.plugin.browserstack.capabilityset.os_version="${osVersion}" -Dtrupi.plugin.browserstack.failurepost.enabled="${PLUGIN_BROWSERSTACK_ENABLED}" -Dtrupi.plugin.selenoid.capabilities.enabled="${PLUGIN_SELENOID_ENABLED}" @bischo ff dev
  • 46. Real world example Selenium tests with Make invocation make test-local BASE_URL=https://www.trivago.com BROWSERS="chrome" @bischo ff dev
  • 47. Real world example Selenium tests with Make invocation make test-grid BASE_URL=https://www.trivago.com BROWSERS="chrome" @bischo ff dev
  • 48. Real world example Selenium tests with Make invocation make test-grid BASE_URL=https://www.trivago.com BROWSERS="chrome, firefox" DEVICES="Samsung Galaxy" FEATURES="src/test/resources/features/Search.feature" @bischo ff dev
  • 49. Real world example Invocation in a GitHub action - name: Run tests id: runUiTests working-directory: ./tests run: > make test-grid BASE_URL="${{ github.event.inputs.baseUrl }}" BROWSERS="${{ steps.setBrowser.outputs.browserString }}" FEATURES="${{ github.event.inputs.features }}" @bischo ff dev
  • 51. Just A few facts • Heavily inspired by make • It is only a command runner (no .Phony needed) • Runs on Linux, MacOS and Windows • Needs to be installed on the host system/container @bischo ff dev
  • 52. Justfile Rule & Recipe myRecipe: someDependency @echo "Hello from Just" someDependency: @echo "I am a dependency" @bischo ff dev
  • 54. Every project is different. @bischo ff dev
  • 55. Use the right tool for the job! @bischo ff dev
  • 57. Testing is a team effort. @bischo ff dev
  • 60. „Architect of destruction“ Barney Stinson: “I’m gonna give you four words to live by: new is always better! […]” Ted Mosby: “And this theory applies to everything?” Barney Stinson: “Everything.” @bischo ff dev Original version
  • 61. „Architect of destruction“ Revised version Barney Stinson: “I’m gonna give you fi ve words to live by: new is not always better! [...]” Ted Mosby: “I agree!” @bischo ff dev
  • 62. Thank you, TestMμ! @bischo ff dev | softwaretester.blog