CI : the first_step: Auto Testing with CircleCI - (MOSG)
- 2. Continuous Integration
In software engineering, continuous integration (CI) is the
practice of merging all developer working copies to a
shared mainline several times a day.
Grady Booch first named and proposed CI in his 1991
method,[1] although he did not advocate integrating
several times a day.
Extreme programming (XP) adopted the concept of CI and
did advocate integrating more than once per day - perhaps
as many as tens of times per day.
wikipedia
- 3. Almost development works are
‘Enhancement of current system’.
Why CI?
* Rapid cycle :
‘Plan(Enlarge) - Dev - Measure(Enlarge)’
* Tests : not only for new code, but also ALL.
(to avoid regression)
- 4. Almost development works are
‘Enhancement of current system’.
Why CI?
* Rapid cycle :
‘Plan(Enlarge) - Dev - Measure(Enlarge)’
* Tests : not only for new code, but also ALL.
(to avoid regression)
Tests are increasing
||
Dev cycle is going faster
- 5. Almost development works are
‘Enhancement of current system’.
Why CI?
* Rapid cycle :
‘Plan(Enlarge) - Dev - Measure(Enlarge)’
* Tests : not only for new code, but also ALL.
(to avoid regression)
Tests are increasing
||
Dev cycle is going faster
No way
out
- 6. dev cycle (engineer side)
https://www.apicasystem.com/blog/top-5-tips-avoid-
integration-hell-continuous-integration/
- 7. PLAN CODE BUILD TEST RELEASE DEPLOY
legacy Engineering
dev cycle (engineer side)
- 8. PLAN CODE BUILD TEST RELEASE DEPLOY
Continuous Integration
Continuous Delivery
legacy Engineering
dev cycle (engineer side)
- 9. PLAN CODE BUILD TEST RELEASE DEPLOY
Continuous Integration
Continuous Delivery
legacy Engineering
dev cycle (engineer side)
Use Technology to solve the problem.
Auto-Testing
Auto-Deploy
- 10. dev cycle (from client side)
Huh? Tests?
That’s not my business.
Please ask testers.
No problem.
We are testing our code in
standard dev-flow
- 11. dev cycle (from client side)
Huh? Tests?
That’s not my business.
Please ask testers.
No problem.
We are testing our code in
standard dev-flow
Which engineer do you think better?
- 15. Today’s GOAL
1. push code to github
2. (AUTO) Testing on Circle CI
3. (AUTO) E-mail reporting
very simple
- 17. Flow
create repository on github.com
create sample code and unit test code
register to CircleCI
That’s ALL
You can try auto-testing
very easy !
- 19. sample code
$ git clone git@github.com:nemo-mulodo-vn/test_circleci.git
Cloning into 'test_circleci'...
remote: Counting objects: 20, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 20 (delta 1), reused 17 (delta 1), pack-reused 0
Receiving objects: 100% (20/20), done.
Resolving deltas: 100% (1/1), done.
Checking connectivity... done.
$ cd test_circleci
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
$
preparation
- git clone
- install required modules w/ composer
- 20. sample code
$ ./vendor/bin/phpunit
PHPUnit 4.8.26 by Sebastian Bergmann and contributors.
Runtime: PHP 5.5.30
Configuration: /Users/nemo/git/tmp/test_circleci/phpunit.xml
......
Time: 189 ms, Memory: 4.00MB
OK (6 tests, 6 assertions)
$
test at local environment
- 21. register repository to CircleCI
1. Open CircleCI
https://circleci.com/
Note) Please open github.com with your account on another tab.
- 27. register repository to CircleCI
6. Start build and testing !!!!
environment
closing
testing <- do noting
This screenshot is on a
case without any test code.
NO TEST
- 30. circle.yml
Some more example
machine:
php:
version: 5.6.14
dependencies:
override:
- composer install --prefer-source --no-interaction --dev
test:
override:
- echo “Thanks for spending your time"
circle.yml
https://circleci.com/docs/configuration/
You can deploy code to specified EC2
server and test on the server. (if u need)