automation engineers way to continuous integration · •qa automation manager •conference...

44
Automation engineers way to Continuous Integration Vadzim Zubovich April 2019

Upload: others

Post on 03-Jul-2020

15 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Automation engineers way to Cont inuous I ntegrat ion

Va d z i m Z u b o v i c h

A p r i l 2 0 1 9

Page 2: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Vadzim ZubovichS o f t w a re t e s t i n g t e a m l e a d e r

S o f t w a r e t e s t i n g t e a m l e a d e r

R e s o u r c e m a n a g e r

Va d z i m Z u b o v i c h

• QA Automation manager

• Conference speaker

• COMAQA activist

• Automation trainer and lecturer

Page 3: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Talk Structure

• Briefly about CI

• Typical steps

• Potential difficulties

• Extra tips

• Summary

Page 4: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Briefly about CIW h a t i s i t ?

Practice of integrating new code all the time

Page 5: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Briefly about CIW h a t i s i t r e a l l y ?

Integrating code means testing it

Page 6: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Briefly about CIC I t o d ay

Evolved from Unit testing to full-scale integration and E2E testing

Page 7: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Briefly about CIW h y d o w e n e e d i t ?

“Continuous Integration doesn't get rid of bugs, but it does make them dramatically easier to find and

remove”

– Martin Fowler

Page 8: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Briefly about CIW h y d o A E n e e d i t ?

Main issues of lacking CI for automation engineers

Page 9: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Briefly about CIW h y d o A E n e e d i t ?

Issue 1: Reliance on someone to run tests

Page 10: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Briefly about CIW h y d o A E n e e d i t ?

Issue 2: Lack of automated test data preparation

Page 11: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Briefly about CIW h y d o A E n e e d i t ?

Issue 3: Issues with tests dependency / parallelism are not spotted until the full tests set is ran

Page 12: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Briefly about CIW h y d o A E n e e d i t ?

Issue 4: No general tests health status check

Page 13: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Let ’s go!

Typical way

Page 14: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Let ’s go!F i r s t s t e p

Need to automate our tests build and run

CI server selection

Page 15: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Food for thoughtW h a t t o c o n s i d e r

Developers CI server

Page 16: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Food for thoughtW h a t t o c o n s i d e r

Licenses

Page 17: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Food for thoughtW h a t t o c o n s i d e r

VCS support

Page 18: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Let ’s go!

Tool selected

Page 19: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Moving on!S e c o n d s t e p

Creating an independent job that runs tests on schedule

Page 20: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

What then?T h i rd s t e p

We need test data!

Page 21: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

What then?T h i rd s t e p

Adding data within tests (Before fixtures)

Page 22: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Adding data generationD ra w b a c ks

• Longer testing time

• Data cleanup can be an issue

• “Garbage” data accumulated during test runs

Page 23: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

What then?T h i rd s t e p

Adding data generation through scripting

Page 24: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Adding data generationD ra w b a c ks

• Need to perform rollback

• Large scripts / high error probability

• “Garbage” data accumulated during test runs

• Direct manipulations of the DB may harm existing data

Page 25: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Alternative?F o u r t h s t e p

Adding “mock” database

Page 26: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Adding “mock” databaseD ra w b a c ks

• Need extra coordination with dev team

• Takes more time to initially create

• If DB is subject to change full replacement will be required

Page 27: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

What next?F i f t h s t e p

Running in parallel

Page 28: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Running in parallelI s s u e s / c o u n t e r m e a s u r e s

• Need to make sure the framework is thread-safe

Difficulties: Resolution:

• Group tests smart

• Critical components initialization shouldn’t be static

• Need to maintain tests independence

Page 29: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Extra t ipH e l p i n g t o o l s

• Selenium Grid

Consider using:

• Cloud platforms

• Selenoid

Page 30: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

What next?A n d t h e n

Test reporting

Page 31: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Food for thoughtW h a t t o c o n s i d e r

Readability

VS

Page 32: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Food for thoughtW h a t t o c o n s i d e r

Customization

Page 33: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Food for thoughtW h a t t o c o n s i d e r

Team access

Page 34: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Food for thoughtW h a t t o c o n s i d e r

Dynamics tracing

Page 35: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Reporting

Got it right

Page 36: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

And then?F i n a l s t a g e

Pipeline – a set of consequent builds

Page 37: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

And then?F i n a l s t a g e

Two-stage deployment pipeline

Three-stage pipelineUnit API E2E

Unit API

Page 38: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

And then?F i n a l s t a g e

If an E2E stage finds a bug it is fixed with high priority and within the next build the run of this one test is included into CI

Page 39: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

All setF i n a l s t a g e

Maintain the order

Page 40: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Extra t ipsF ra m e w o r k d e s i g n

Framework should support maximumparametrization

Page 41: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Extra t ipsF ra m e w o r k d e s i g n

Cross-platform capability

Page 42: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Extra t ipsVa r i e t y o f e n v i ro n m e n t s

How many environments should we have?

DevUnit QAAPI UATUI

Page 43: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Summary

• DO get involved in CI process

• Divide tests in layers

• Think about parametrization

• Pay attention to test reporting

• Consider platform-independence

• Use environments wisely

Page 44: Automation engineers way to Continuous Integration · •QA Automation manager •Conference speaker •COMAQA activist •Automation trainer and lecturer. ... testing to full-scale

Thanks for your attention

Skype: csi.vadimzubovich