This document provides instructions for setting up a continuous integration environment using Ubuntu Linux, Ruby on Rails, CruiseControl, JsUnit and Selenium. It includes steps to install the necessary software like Ubuntu, Ruby, Rails, MySQL, Subversion and other tools. It also outlines creating a sample Rails application, importing it to Subversion and configuring CruiseControl for continuous integration. The goal is to have a working CI environment that can be easily replicated and used on real projects.
Gitlab - Creating C++ applications with Gitlab CIUilian Ries
Gitlab is a complete tool that integrates everything from project management to product construction. In this talk I will present how a C ++ project can be analyzed, built, tested and deployed using Gitlab.
The Jenkins open source continuous integration server now provides a “pipeline” scripting language which can define jobs that persist across server restarts, can be stored in a source code repository and can be versioned with the source code they are building. By defining the build and deployment pipeline in source code, teams can take full control of their build and deployment steps. The Docker project provides lightweight containers and a system for defining and managing those containers. The Jenkins pipeline and Docker containers are a great combination to improve the portability, reliability, and consistency of your build process.
This session will demonstrate Jenkins and Docker in the journey from continuous integration to DevOps.
Gitlab - Creating C++ applications with Gitlab CIUilian Ries
Gitlab is a complete tool that integrates everything from project management to product construction. In this talk I will present how a C ++ project can be analyzed, built, tested and deployed using Gitlab.
The Jenkins open source continuous integration server now provides a “pipeline” scripting language which can define jobs that persist across server restarts, can be stored in a source code repository and can be versioned with the source code they are building. By defining the build and deployment pipeline in source code, teams can take full control of their build and deployment steps. The Docker project provides lightweight containers and a system for defining and managing those containers. The Jenkins pipeline and Docker containers are a great combination to improve the portability, reliability, and consistency of your build process.
This session will demonstrate Jenkins and Docker in the journey from continuous integration to DevOps.
In normal project work everybody will have heard the sentence: „On my local machine it worked“! The circumstances which lead to this statement are that there are usually minor inconsistencies within the setup of the different environments. Different operating systems, Java versions or installed hot fixes influent the behavior of the developed application and cause issues. This is where Docker comes in place. Docker automates the deployment of applications and isolates them inside software containers, by providing an additional layer of abstraction and automation but with out the overhead caused by a virtual machine. Ones set up, it limits the installation process to 5 minutes independent which environment. Furthermore, the same application can be reused to run on local machines, data centers or in the cloud. We will show you how we incorporated Docker in our continuous deployment process and how we facilitate it for our development and deployment chain.
An introduction into docker, going from the basics of running it locally, how to create (test) environments with multiple containers, on to discussing the challenges of running a mature cluster orchestration setup on production.
http://www.meetup.com/BruJUG/events/228994900/
During this session, you will presented a solution to the problem of scalability of continuous delivery in Jenkins, when your organisation has to deal with thousands of jobs, by introducing a self-service approach based on the "pipeline as code" principles.
Jenkins is a Continuous Integration tool to manage your environment that fires off jobs like cron or when a button is pushed. This talk will walk you through setting up a Jenkins site, complete with slave nodes on the servers doing the real work, and some simple jobs to get a feel for what it can do for you.
Real life examples included based on an actual migration between data centers requiring Jenkins had to be installed fresh.
This talk has been presented at:
2016-08-20 in Philadelphia
- https://fosscon.us/
2016-08-26 in Cluj-Napoca, Romania
- http://act.yapc.eu/ye2016/talk/6751
- https://youtu.be/Nj84bBCssps
Pipeline as code - new feature in Jenkins 2Michal Ziarnik
What is pipeline as code in continuous delivery/continuous deployment environment.
How to set up Multibranch pipeline to fully benefit from pipeline features.
Jenkins master-node concept in Kubernetes cluster.
Jenkins to Gitlab - Intelligent Build-PipelinesChristian Münch
At netz98 we moved from Jenkins to Gitlab. The slides show some insides about Testing of PHP libraries, Magento 1 and Magento 2 modules. How to setup a scalable and fast Gitlab-Pipeline with Docker images.
How do you deploy a game with millions of online users, playing across the globe, without interrupting their experience? Learn how Scopely uses AWS automation tools to build, deploy, and manage highly-scalable mobile games. They show how to use AWS CloudFormation and Ansible to build andquot;golden AMIs.andquot; See how they do green/blue deployment of those AMIs using Auto Scaling and Amazon Elastic Load Balancing, to avoid kicking players offline. Then, hear how they leverage Amazon Kinesis, ElasticSearch, and Amazon SNS to create a unified monitoring and alerting infrastructure for your games. Finally, learn how Scopely use Amazon VPC and AWS Identity and Access Management (IAM) to keep your scalable gaming infrastructure safe and secure.
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...Docker, Inc.
This lightning talk will show you how simple it is to apply CI to the creation of Docker images, ensuring that each time the source is changed, a new image is created, tagged, and published. I will then show how easy it is to then deploy containers from this image and run tests to verify the behaviour.
You want to learn what virtualization is all about? I’ll talk about high level concepts, tips and tricks and best practices. You will learn all that and even why Azure might be an interesting choice when we talk developer virtualization. Concepts like Sysprep, Differencing drives, snapshot intrigue you? I’ll let you know all about them and more! Come join me to explore all that virtualization as to offer
In normal project work everybody will have heard the sentence: „On my local machine it worked“! The circumstances which lead to this statement are that there are usually minor inconsistencies within the setup of the different environments. Different operating systems, Java versions or installed hot fixes influent the behavior of the developed application and cause issues. This is where Docker comes in place. Docker automates the deployment of applications and isolates them inside software containers, by providing an additional layer of abstraction and automation but with out the overhead caused by a virtual machine. Ones set up, it limits the installation process to 5 minutes independent which environment. Furthermore, the same application can be reused to run on local machines, data centers or in the cloud. We will show you how we incorporated Docker in our continuous deployment process and how we facilitate it for our development and deployment chain.
An introduction into docker, going from the basics of running it locally, how to create (test) environments with multiple containers, on to discussing the challenges of running a mature cluster orchestration setup on production.
http://www.meetup.com/BruJUG/events/228994900/
During this session, you will presented a solution to the problem of scalability of continuous delivery in Jenkins, when your organisation has to deal with thousands of jobs, by introducing a self-service approach based on the "pipeline as code" principles.
Jenkins is a Continuous Integration tool to manage your environment that fires off jobs like cron or when a button is pushed. This talk will walk you through setting up a Jenkins site, complete with slave nodes on the servers doing the real work, and some simple jobs to get a feel for what it can do for you.
Real life examples included based on an actual migration between data centers requiring Jenkins had to be installed fresh.
This talk has been presented at:
2016-08-20 in Philadelphia
- https://fosscon.us/
2016-08-26 in Cluj-Napoca, Romania
- http://act.yapc.eu/ye2016/talk/6751
- https://youtu.be/Nj84bBCssps
Pipeline as code - new feature in Jenkins 2Michal Ziarnik
What is pipeline as code in continuous delivery/continuous deployment environment.
How to set up Multibranch pipeline to fully benefit from pipeline features.
Jenkins master-node concept in Kubernetes cluster.
Jenkins to Gitlab - Intelligent Build-PipelinesChristian Münch
At netz98 we moved from Jenkins to Gitlab. The slides show some insides about Testing of PHP libraries, Magento 1 and Magento 2 modules. How to setup a scalable and fast Gitlab-Pipeline with Docker images.
How do you deploy a game with millions of online users, playing across the globe, without interrupting their experience? Learn how Scopely uses AWS automation tools to build, deploy, and manage highly-scalable mobile games. They show how to use AWS CloudFormation and Ansible to build andquot;golden AMIs.andquot; See how they do green/blue deployment of those AMIs using Auto Scaling and Amazon Elastic Load Balancing, to avoid kicking players offline. Then, hear how they leverage Amazon Kinesis, ElasticSearch, and Amazon SNS to create a unified monitoring and alerting infrastructure for your games. Finally, learn how Scopely use Amazon VPC and AWS Identity and Access Management (IAM) to keep your scalable gaming infrastructure safe and secure.
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...Docker, Inc.
This lightning talk will show you how simple it is to apply CI to the creation of Docker images, ensuring that each time the source is changed, a new image is created, tagged, and published. I will then show how easy it is to then deploy containers from this image and run tests to verify the behaviour.
You want to learn what virtualization is all about? I’ll talk about high level concepts, tips and tricks and best practices. You will learn all that and even why Azure might be an interesting choice when we talk developer virtualization. Concepts like Sysprep, Differencing drives, snapshot intrigue you? I’ll let you know all about them and more! Come join me to explore all that virtualization as to offer
Fine-tuning your development environment means more than just getting your editor set up just so -- it means finding and setting up a variety of tools to take care of the mundane housekeeping chores that you have to do -- so you have more time to program, of course! I'll share the benefits of a number of yak shaving expeditions, including using App::GitGot to batch manage _all_ your git repos, App::MiseEnPlace to automate getting things _just_ so in your working environment, and a few others as time allows.
Delivered at OpenWest 2016, 13 July 2016
5/13/13 presentation to Austin DevOps Meetup Group, describing our system for deploying 15 websites and supporting services in multiple languages to bare redhat 6 VMs. All system-wide software is installed using RPMs, and all application software is installed using GIT or Tarball.
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Fabrice Bernhard
This is the presentation given at the Symfony Live 2011 conference. It is an introduction to the new agile movement spreading in the technical operations community called DevOps and how to adopt it on web development projects, in particular Symfony projects.
Plan of the slides :
- Configuration Management
- Development VM
- Scripted deployment
- Continuous deployment
Tools presented in the slides:
- Puppet
- Vagrant
- Fabric
- Jenkins / Hudson
BeagleBone Black: Platform Bring-Up with Upstream ComponentsGlobalLogic Ukraine
This document is intended to give the user overall instructions on how to obtain, build and flash upstream software to the BeagleBone Black board, with detailed explanation of all related features and components.
Please find the additional details in this deck: https://www.slideshare.net/GlobalLogicUkraine/beaglebone-black-with-upstream-software
The respective workshop was held by Victoriia Taraniuk (Associate Manager, Quality Assurance, Consultant, GlobalLogic) at GlobalLogic Mykolaiv Embedded TechTalk #1 on May 25, 2018.
Since Fremantle Extras applications will eventually be submitted to the Mer builder it may be a good idea to introduce it.
We use the openSuse Open Build Service; a GPL service that provides an emulated, pristine (yes, I'm looking at you autobuilder and scratchbox), dependency driven build environment.
I'll talk about the processes around Mer builds, access controls, managing integration with our DVCS (git), acceleration tricks and generally how to make good use of things you find lying about on the web.
This slideset has useful notes - see tab next to 'Comments'
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
1. If you are using this presentation from the
OpenOffice file instead of the PDF:
For best formatting, please install the
FreeSansBold.ttf font under
openoffice/share/font or windows/fonts:
http://thewoolleyweb.com/ci_for_the_web_
2.0_guy_or_gal/tools/font/FreeSansBold.ttf
(even then, some OpenOffice platforms
may require you to do outline -> select all
-> and pick the font. But hey, it's free...)
2. Welcome! If you want to
follow along, borrow a
flash drive, copy the
contents to your drive,
and see the README.
Or, download from:
thewoolleyweb.com/
ci_for_the_web_2.0_guy_or_gal
46. * “everything” except
the stuff that doesn't
work on your project
or environment.
Error messages and
Google are your
friend :)
47. As a matter of fact, it almost
certainly won't work perfectly
for you. Integrating this stuff
is hard, and new problems
arise as tools and libraries
evolve. Embrace the
bleeding cutting edge, keep a
positive attitude, and help fix
bugs.
64. No time to install
Linux live, but
VMWare and
images are on
USB Keys
65. My Barebones Linux VM Setup:
Base:
VMWare on Macbook Pro 17”
Ubuntu 7.04 desktop VM from ISO
VMware Tools installed
Optional:
Change resolution (1680x1050)
Mouse Acceleration and Sensitivity
Terminal scrollback
102. At this point, you may need to
reboot (System -> Quit ->
Restart) in order for the
VMware Tools CD image to
mount correctly, especially if
you already have the Ubuntu
ISO image mounted.
106. Install VMware Tools (Optional):
$ cd ~/vmware-tools-distrib
$ sudo ./vmware-install.pl
# enter password for sudo
# hit enter repeatedly to accept defaults for all
prompts
# reboot (System -> Quit -> Restart)
107. Opening an existing VM
Image Copy:
/presentation
/screenshots
/03_virtual_machine_cop
y
114. Legend
$ == shell input
# == comment or instructions
(nothing) == editor input or stdin
Example:
# sudo should prompt for a password unless you've
sudo'd recently
$ sudo ls
password
# should get file list
118. Install Ruby from source:
# install all prereqs/extensions in case you need
them
$ sudo apt-get update
$ sudo apt-get install -y zlib1g zlib1g-dev
$ sudo apt-get install -y libssl-dev openssl
$ wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-
1.8.5.tar.gz
$ tar -zxvf ruby-1.8.5.tar.gz
$ cd ruby-1.8.5
$ gedit ext/Setup
# Uncomment all “non-Win” lines (all except
Win32API and win32ole) by removing “#”
$ ./configure
$ make
$ sudo make install
123. Install ant:
$ sudo apt-get install -y ant
$ sudo apt-get install -y ant-optional
# By default, this uses Gnu java, not Sun's...
124. Install mozilla as an alternate browser
# because jsunit will kill the browser it is testing
# libgtk1.2 is a dependency
$ sudo apt-get install -y libgtk1.2
$ wget http://ftp-
mozilla.netscape.com/pub/mozilla.org/mozilla/release
s/mozilla1.7.13/mozilla-i686-pc-linux-gnu-1.7.13-
installer.tar.gz
$ tar -zxvf mozilla-i686-pc-linux-gnu-1.7.13-
installer.tar.gz
$ sudo mozilla-installer/mozilla-installer
# install Navigator only
$ /usr/local/mozilla/mozilla &
129. Create databases for rails project
$ mysql -u root
mysql> create database mysite_development;
mysql> create database mysite_test;
mysql> create database mysite_production;
# (prod needed because cruise complained if it was
not there)
mysql> exit
130. Hack rails database.yml to match debian defaults
$ gedit config/database.yml
# add the following entry to all three databases
socket: /var/run/mysqld/mysqld.sock
# NOTE: Sometimes, Rails will do this for you
automatically...
131. Create a rails migration and db table
$ ruby script/generate migration CreateUserTable
$ gedit db/migrate/001_create_user_table.rb
def self.up
create_table quot;usersquot; do |t|
t.column quot;namequot;, :string
end
end
def self.down
drop_table quot;usersquot;
end
$ rake db:migrate
132. Remove default index.html and create a page
$ rm public/index.html
$ ruby script/generate scaffold User
$ gedit test/functional/users_controller_test.rb
# change quot;users(:first)quot; to quot;users(:one)quot; – there
should only be one occurrence
133. Test rails site
$ rake # should pass all tests
$ ruby script/server
# New Terminal Tab: File -> Open Tab or Ctrl-Shift-T
# should be in mysite dir
$ firefox http://localhost:3000/users
# create a user
134. Import site into subversion
# change back to home dir (~)
$ cd
# remove temp files we don't want to check in
$ rm -rf mysite/log/*
$ rm mysite/db/schema.rb
$ rm -rf mysite/tmp
$ svn import mysite file:///home/ci/repo/mysite -m
quot;importquot;
$ rm -rf mysite
$ svn co file:///home/ci/repo/mysite mysite
135. Set svn:ignores
# ignore all temp files, to have a clean workspace
$ cd mysite
$ export EDITOR=gedit
$ svn propedit svn:ignore .
tmp
logs
$ svn propedit svn:ignore log
*
$ svn propedit svn:ignore db
schema.rb
$ svn commit -m quot;ignoresquot;
$ cd
139. Check out a recent build of CruiseControl.rb
$ svn checkout
http://cruisecontrolrb.rubyforge.org/svn/trunk/@521
cc
140. Do a temporary hack to fix a bug in cc.rb rev 521
$ cd cc
$ mkdir projects
$ echo '1' > projects/data.version
$ cd
141. Set up project in cruisecontrol
$ cd cc
$ ./cruise add MySite --url file:///home/ci/repo/mysite
$ ./cruise start
142. View cruisecontrol web page
# Ctrl-Shift-T for new Terminal tab
$ firefox localhost:3333
# click MySite
# Should be passing
143. Take this opportunity to
familiarize yourself with
cruisecontrol.rb. It's not
covered here ;)
http://cruisecontrolrb
.thoughtworks.com/
144. Add cruise task to Rakefile
# cd to Rails project dir
$ cd ~/mysite
$ gedit Rakefile
# Add cruise task to bottom after 'requires':
task :cruise do
Rake::Task['test'].invoke
end
$ svn commit Rakefile -m quot;add cruise taskquot;
# Check cruise webpage, should still be passing
145. Tweak firefox for automation
# open firefox, navigate to 'about:config'
# search for
'browser.sessionstore.resume_from_crash'
# toggle to false
# Preferences - Tabs - uncheck quot;warn when closing
multiple tabs'
# Maybe turn off update prompts too...
147. Download and Unzip JsUnit
$ cd
$ wget
http://easynews.dl.sourceforge.net/sourceforge/jsunit
/jsunit2.2alpha11.zip
$ unzip jsunit2.2alpha11.zip
# copy junit.jar file to Ant lib dir (required by Ant)
$ sudo cp jsunit/java/lib/junit.jar /usr/share/ant/lib/
148. Copy jsunit to your app and check in
$ cd mysite/public/javascripts
$ mv /home/ci/jsunit .
$ svn add jsunit
$ export EDITOR=gedit
$ svn propedit svn:ignore jsunit/logs
# add * to ignore list
$ svn propedit svn:executable jsunit/bin/unix/start-
firefox.sh
# enter “true”
$ svn commit -m quot;add jsunitquot;
149. Create a jsunit test
$ mkdir test_pages
$ gedit test_pages/prototype_test.html
<html>
<head>
<script language=quot;JavaScriptquot;
type=quot;text/javascriptquot;
src=quot;../jsunit/app/jsUnitCore.jsquot;></script>
<script language=quot;JavaScriptquot;
type=quot;text/javascriptquot; src=quot;../prototype.jsquot;></script>
<script language=quot;javascriptquot;>
function testPrototypeWordSplit() {
string = 'one two three';
assertEquals('one', ($w(string))[0]);
}
</script>
</head>
<body></body>
</html>
150. Run the jsunit test manually from browser and
commit
$ cd
$ cd mysite
$ ruby script/server # unless you still have it running
$ firefox
http://localhost:3000/javascripts/jsunit/testRunner.ht
ml
# Enter this in the quot;Runquot; field and click “Run”:
http://localhost:3000/javascripts/test_pages/prototyp
e_test.html
$ svn add public/javascripts/test_pages
$ svn commit -m quot;jsunit testquot;
151. Take this opportunity to
familiarize yourself with
JsUnit and JsUnit
Server. It's not covered
here ;)
http://jsunit.net/
152. quot;Puntquot; and make a manual jsunit_start_server script
# Because automated process management is not
TSTTCPW for this tutorial, and it's hard
# This is also easily ported to a batch file on windows
$ cd mysite
$ gedit script/jsunit_start_server.sh
ant -f
/home/ci/mysite/public/javascripts/jsunit/build.xml
-DbrowserFileNames=
/home/ci/mysite/public/javascripts/jsunit/bin/unix/star
t-firefox.sh -Dport=8081 start_server
153. Check in jsunit_start_server script and leave it
running
$ svn add script/jsunit_start_server.sh
$ svn propedit svn:executable
script/jsunit_start_server.sh
# add 'true' line
$ script/jsunit_start_server.sh
# ignore warning about tools.jar
# make sure it starts and leave it running
# ctrl-c if you want to kill it
# open a new terminal tab
$ svn ci -m quot;add jsunit start scriptquot;
154. Add jsunit task
$ gedit Rakefile
task :cruise do
Rake::Task['test'].invoke
Rake::Task['jsunit_distributed_test'].invoke
end
task :jsunit_distributed_test do
output = `ant -f public/javascripts/jsunit/build.xml
-Durl=http
://localhost:8080/jsunit/jsunit/testRunner.html?testPa
ge=/jsunit/test_pages/prototype_test.html
-DremoteMachineURLs=http://localhost:8081
-DresourceBase=public/javascripts distributed_test`
raise quot;JsUnit Failed:nquot; + output unless
$?.success?
puts quot;JsUnit tests passedquot;
end
155. Commit jsunit task and check cruise
# Open cruise webpage under mozilla
# jsunit will kill firefox, so we need a different
browser
$ /usr/local/mozilla/mozilla http://localhost:3333
# if you want, add a quick launch for mozilla: right
click -> add to panel -> custom application launcher
$ svn commit Rakefile -m quot;add jsunit_distributed_test
taskquot;
# Check cruise webpage, should still be passing
157. Selenium 0.8.1 is
proven, 0.9.0 has
had problems.
Latest unreleased
version is
reported to be OK.
158. Download Selenium Remote Control
$ cd
$ wget http://release.openqa.org/selenium-remote-
control/0.8.1/selenium-remote-control-0.8.1.zip
$ unzip selenium-remote-control-0.8.1.zip
159. Make a manual selenium_start_server script
$ cd mysite
$ cp /home/ci/selenium-remote-control-
0.8.1/server/selenium-server.jar lib
$ svn add lib/selenium-server.jar
$ gedit script/selenium_start_server.sh
java -jar /home/ci/mysite/lib/selenium-server.jar
-interactive
$ svn add script/selenium_start_server.sh
$ export EDITOR=gedit
$ svn propedit svn:executable
script/selenium_start_server.sh
# add 'true' line
$ script/selenium_start_server.sh
# make sure it starts and leave it running, ctrl-c to kill it
# Open new terminal tab
$ svn ci -m quot;add selenium start script and jarquot;
160. Set up selenium test dir and copy ruby API file
$ cd mysite
$ mkdir test/selenium
$ cp ~/selenium-remote-control-
0.8.1/ruby/selenium.rb test/selenium
161. Create selenium test stub
$ gedit test/selenium/user_test.rb
require 'test/unit'
require File.expand_path(File.dirname(__FILE__) + '/selenium')
class UserTest < Test::Unit::TestCase
def setup
@selenium =
Selenium::SeleneseInterpreter.new(quot;localhostquot;, 4444, quot;*firefox
/usr/lib/firefox/firefox-binquot;, quot;http://localhost:3001/quot;, 10000);
@selenium.start
end
def teardown
@selenium.stop
end
def test_user_add_flow
end
end
162. Fill in selenium test stub
$ gedit test/selenium/user_test.rb
def test_user_add_flow
timestamp = Time.new.to_s
user_name = 'joe ' + timestamp
@selenium.open quot;http://localhost:3001/usersquot;
@selenium.click quot;link=New userquot;
sleep 2 # <- Sleeping is bad! Use a wait_for loop...
@selenium.type quot;id=user_namequot;, user_name
@selenium.click quot;commitquot;
sleep 2
assert @selenium.is_text_present(user_name)
end
163. Create selenium_test rake task including start and stop of
server
$ gedit Rakefile
task :cruise do
...
Rake::Task['selenium_test'].invoke
end
task :selenium_test do
begin
process = IO.popen(quot;ruby
/home/ci/cc/projects/MySite/work/script/server --port=3001quot;)
output = `ruby test/selenium/user_test.rb`
raise quot;Selenium Failed:nquot; + output unless $?.success?
puts quot;Selenium tests passedquot;
ensure
Process.kill(9,process.pid)
end
end
164. Check in and check cruise
$ svn add test/selenium
$ svn commit -m quot;selenium testquot;
# check cruise, it should run everything and be green
165. Break tests and fix them!
# cause ruby/jsunit/selenium failures, and check
them in
# see cruise go red, then fix them
# click links for ruby/selenium failures
# there's a test bug! (next page after too many tests)
# good to drop DB before each CI run...
# This naive implementation has return code bugs
(crash if webrick already running)
213. Random Gotchas / Mantras:
* “It's not easy being Green”
* Broken Windows are Bad (“Who cares, it's
always red...”)
* False Negatives are Bad
* Crying Wolf (“it failed for no reason”)
* “Intermittent” failures (but it's not intermittent
after you can reproduce it)
* “Works Locally” (is your local environment the
same as CI? Which one is Prod closer to???)
* You can always “temporarily” disable a test in CI
* One disabled test is better than a red CI
* False Positives are Bad too - being Green, when
return code (echo $?) from some step is not 0
* Browser Settings (autoupdate, etc) Preventing
Browser Close