RubyKaigi 2015-DIY-Testing
-
Upload
emily-stolfo -
Category
Software
-
view
210 -
download
0
Transcript of RubyKaigi 2015-DIY-Testing
Ruby Engineer on the drivers team.
Based in Berlin.Maintain the gems:
bson mongo mongoid bson_ext mongo_kerberos
@EmStolfo
MongoDB Drivers
Interface to the server.
10 official drivers available.
Many started as OS projects.
History
Organizations can experience 1 interface.
Specifications guide design and provide documentation.
Rewrites with collective knowledge.
MongoDB DriversRevamp
Specifications
Equally valuable to the drivers team as to the community.
Server Discovery and Monitoring Spec
Logic required to make an application using MongoDB highly available.
Requirements for validating compliance• Unit tests. • Integration tests. • Tests define as “data”. • Language-agnostic. • Reproducible scenarios.
benefitsFormat: YAML
• Describes data. • Can translate to actions. • Most languages can use a YAML parsing
library. • Driver authors write a reusable harness. • Changes in the spec can be
communicated via additional YAML tests or changes to existing ones.
Test requirements• Unit tests. • Integration tests. • Defined as “data”. • Language-agnostic. • Reproducible scenarios.
Test requirements• Unit tests. • Integration tests. • Defined as “data”. • Language-agnostic. • Reproducible scenarios.
Mongo Orchestration
Define clusters using JSON.Manipulate clusters via RESTful API.
Mongo OrchestrationHTTP server providing REST interface to manage
multiple MongoDB processes on the same machine.
Implemented in python.
What about Automation!?
• Is intended for testing. • Starts processes on one machine. • Allows fault injection. • Does not have a UI. • Has no protection against downtime. • Has one agent, so no resiliency. • Does not handle operation tasks.
Mongo Orchestration..!
Benefits of MO• Reproducible test scenarios. • Abstracts differing configuration
options across MongoDB versions. • Uniform interface regardless of OS. • Ability to define different locations
of MongoDB installations for multi-version testing.
Multi-version testingMulti-topology testing
SSLAuthentication
Used internally
Drivers integration tests
Integration testsTest driver behavior. Input: cluster state
Output: driver behavior
Mongo Orchestration
Harness structure
1. Resource (MO cluster) 2. Specification (parsed YAML) 3. Test (can be run)
PR #584 [WIP] Integration tests using Mongo Orchestration
Ask yourself1. Unit or integration tests? 2. Need to be language-agnostic? 3. Directly related to specs or
documentation?