Skip to content

Instantly share code, notes, and snippets.

@bfeigin
Created May 6, 2013 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bfeigin/5528599 to your computer and use it in GitHub Desktop.
Save bfeigin/5528599 to your computer and use it in GitHub Desktop.
Eesti Testi
RUNNING!:
cd ROOT/spec/batteries/google && \
ID=d38214c \ # Not Required runs a specific test or test group
(getting this id is complicated see trick below)
LOCALE=en-US \ #will filter tests based on the locale only
GOODDRIVER=disk_then_silo \ # known good driver (this will hit cache from disk then perform silo style scrape)
GOODDISK=output/cache-silo \ # location of known good cache files
DRIVER=disk_then_phantom \ # same as above
DISK=output/cache-phantom \ # same as above
mocha --compilers coffee:coffee-script --timeout 19000 google.battery.coffee
Theory behind KNOW GOOD
Known good tests are relative comparison tests
they involve taking a good serp and comparing it to retreived results.
Generally this is Serp vs Serp with one being pre-approved and the other compaired
this is something like percent urls in common between two serps should be > xx%
Anything that can be specificly verified i.e. "a result must have a title" goes into the generic test files
Important Files:
cd ROOT/spec/batteries/google
Generic:
google.battery.coffee
Tests for things that won't change,
looks at google.searches.coffee
google.searches.coffee
List of hashes used to construct query-locale-params for varius tests
Look in ROOT/batteries/locales.js for definitions of the locale params
Known Good:
google.kg.battery.coffee
Tests for known good style
google.kg.searches.coffee
search specifications for known good tests
Core battery ROOT/batteries:
has a bunch of helper methods,
custom assertions in chai_should
Getting search ID trick:
1) in searches.coffee, add a bogus locale
testGroup:
querry: 'test'
locales: locales.all + 'bogus'
2) wait for the test to fail.
3) there are two hash ids that will be spit out in brackets i.e.
"failed on {f3la31} running test {12ijfa}"
f3l is the group of tests (ie an @scrape in google.battery.coffee)
12i is the specific test that failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment