-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from jchuerva/add_reverse_geo
Add reverse geo
- Loading branch information
Showing
25 changed files
with
904 additions
and
3,723 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,7 @@ Gemfile.lock | |
.bundle | ||
.ruby-version | ||
=.vendor/* | ||
.idea/ | ||
.idea/ | ||
tmp_reports/* | ||
reports/* | ||
report.html |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This is the configuration used to check the rubocop source code. | ||
|
||
AllCops: | ||
Exclude: | ||
# Currently excluded for future investigation | ||
- '**/hooks.rb' | ||
- '**/env.rb' | ||
- '**/http_util.rb' | ||
- 'features/step_definitions/helpers/table_transform.rb' | ||
|
||
################## Customized rules ################## | ||
|
||
Metrics/LineLength: | ||
Max: 150 | ||
Exclude: | ||
- '**/long-text.rb' | ||
|
||
Metrics/AbcSize: | ||
Max: 30 | ||
|
||
Metrics/MethodLength: | ||
Max: 15 | ||
|
||
Metrics/BlockLength: | ||
Max: 30 | ||
|
||
Style/RegexpLiteral: | ||
EnforcedStyle: slashes | ||
AllowInnerSlashes: true | ||
|
||
# Waiting for answer regarding snake_case or kebab-case use in FileNames | ||
Style/FileName: | ||
Enabled: false | ||
|
||
# Investigate Carriage error | ||
EndOfLine: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,45 @@ | ||
# encoding: utf-8 | ||
|
||
#require 'rubygems' | ||
require 'cucumber' | ||
require 'cucumber/rake/task' | ||
|
||
require 'cukeforker' | ||
require 'cukeforker/rake_task' | ||
require 'jsonpath' | ||
|
||
#require 'cuke_sniffer' | ||
|
||
require 'report_builder' | ||
|
||
task "move_to_test_directory" do | ||
Dir.chdir('features') | ||
end | ||
processes = ENV['processes'] || 10 | ||
|
||
Cucumber::Rake::Task.new("running_geo_api_tests") do |t| | ||
# t.cucumber_opts = ["--tags", "@carlos", "--tags", "~@pend", "--format", "html", "--out", "report.html", "--format", "junit", "--out", "testoutput", "--format", "pretty", "--format", "rerun", "--out", "rerun.txt"] | ||
Cucumber::Rake::Task.new('running_geo_api_tests') do |t| | ||
#t.cucumber_opts = ["--tags", "@carlos", "--tags", "~@pend", "--format", "report/report.html", "--out", "report.html", "--format", "junit", "--out", "testoutput", "--format", "pretty", "--format", "rerun", "--out", "rerun.txt"] | ||
t.cucumber_opts = ["--tags", "@carlos"] | ||
end | ||
|
||
# Cucumber::Rake::Task.new("running_parallel_geo_api_tests") do | ||
# CukeForker::Runner.run CukeForker::Scenarios.all | ||
# #extra_args: %W[-f CukeForker::Formatters::JunitScenarioFormatter --out results/junit] | ||
# end | ||
Cucumber::Rake::Task.new('running_all_tests') do |t| | ||
t.cucumber_opts = ["--tags", "~@pend", "--format", "html", "--out", "report.html", "--format", "junit", "--out", "testoutput", "--format", "pretty"] | ||
end | ||
|
||
task :cleanup_cuke_forker do | ||
puts " ========Deleting old reports and logs=========" | ||
#FileUtils.rm_rf('reports/test_report') | ||
Dir.mkdir("features/reports/test_report") | ||
task 'prepare_parallel_report' do | ||
FileUtils.rm_rf('reports') | ||
Dir.mkdir('reports') | ||
|
||
puts "configure reportbuilder" | ||
ReportBuilder.configure do |config| | ||
config.json_path = 'reports/test_report' | ||
config.report_path = 'reports/test_report' | ||
config.report_tabs = [:overview, :features, :scenarios, :errors] | ||
config.json_path = 'tmp_reports' | ||
config.report_path = 'reports/reports' | ||
config.report_types = [:json, :html] | ||
config.report_tabs = [:overview, :features, :scenarios, :errors] | ||
config.report_title = 'Test Results' | ||
config.report | ||
end | ||
end | ||
|
||
task :all do | ||
Rake::Task['cleanup_cuke_forker'].invoke | ||
puts "===== Executing Tests in parallel" | ||
task 'create_report' do | ||
ReportBuilder.build_report | ||
FileUtils.rm_rf('tmp_reports') | ||
end | ||
|
||
Dir.chdir('features/') | ||
task 'parallel_all_tests' do | ||
Rake.application.invoke_task('prepare_parallel_report') | ||
|
||
CukeForker::Runner.run CukeForker::Scenarios.tagged('@carlos'), {:max => 10, | ||
:log => true, :format => :json, :out => 'reports/test_report'} | ||
puts "===== End Executing Tests in parallel" | ||
puts "===== Executing report" | ||
ReportBuilder.build_report | ||
puts "===== End Executing report" | ||
FileUtils.rm_rf('tmp_reports') | ||
Dir.mkdir('tmp_reports') | ||
|
||
end | ||
system "bundle exec parallel_cucumber -n #{processes} features/ -o \'-p parallel -f json -o tmp_reports/feature$TEST_ENV_NUMBER.json \'" | ||
#system "bundle exec parallel_cucumber features/ -o \"-r features -p parallel \" -n #{processes} " or exit!($?.exitstatus) | ||
Rake.application.invoke_task('create_report') | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# cucumber.yml | ||
##YAML Template | ||
|
||
parallel: -f progress -f ParallelTests::Cucumber::FailuresLogger --out tmp_reports/cucumber_failures.log |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@ok | ||
Feature: Cover the happy path case | ||
|
||
Scenario Outline: valid components | ||
When I successfully browse to the url | ||
| parameter | value | | ||
| components | <components_value> | | ||
Then I see response with status 'OK' | ||
And I see <num_results> result in the response | ||
And I see first response formatted_address '<formatted_address>' | ||
And I see first response contains '<location_type>' geographic coordinates | ||
|
||
Examples: | ||
| components_value | formatted_address | location_type | num_results | | ||
| route:Annegatan | Annankatu, 00101 Helsinki, Finland | GEOMETRIC_CENTER | 1 | | ||
| locality:La Palma | La Palma, CA, USA | APPROXIMATE | 1 | | ||
| administrative_area:Huelva | Huelva, Spain | APPROXIMATE | 1 | | ||
| postal_code:94107 | San Francisco, CA 94107, USA | APPROXIMATE | 1 | | ||
| country:Spain | Spain | APPROXIMATE | 1 | | ||
| locality:La Palma \|country:Spain | 30593 La Palma, Murcia, Spain | APPROXIMATE | 2 | | ||
| locality:La Palma \|administrative_area:Huelva | 21700 La Palma del Condado, Huelva, Spain | APPROXIMATE | 1 | | ||
| locality:La Palma \|administrative_area:Huelva \|country:Spain | 21700 La Palma del Condado, Huelva, Spain | APPROXIMATE | 1 | | ||
|
||
Scenario: valid Address and components | ||
When I successfully browse to the url | ||
| parameter | value | | ||
| address | 6 Mozarabes | | ||
| components | administrative_area:Huelva\|postal_code:21002 | | ||
Then I see response with status 'OK' | ||
And I see 1 result in the response | ||
And I see first response contains an address_component | ||
| type | attribute | value | | ||
| administrative_area_level_2 | short_name | Huelva | | ||
And I see first response contains 'ROOFTOP' geographic coordinates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
@ok | ||
Feature: Cover the happy path case | ||
|
||
Scenario Outline: valid Address | ||
When I successfully browse to the url | ||
| parameter | value | | ||
| address | <address_value> | | ||
Then I see response with status 'OK' | ||
And I see <num_results> result in the response | ||
And I see first response formatted_address '<formatted_address>' | ||
And I see first response contains '<location_type>' geographic coordinates | ||
|
||
Examples: | ||
| address_value | formatted_address | location_type | num_results | | ||
| 88+Colin+P+Kelly+Jr+St,+San+Francisco | 88 Colin P Kelly Jr St, San Francisco, CA 94107, USA | ROOFTOP | 1 | | ||
| 88 Colin P Kelly Jr St,+San Francisco | 88 Colin P Kelly Jr St, San Francisco, CA 94107, USA | ROOFTOP | 1 | | ||
| 94107 | San Francisco, CA 94107, USA | APPROXIMATE | 1 | | ||
| San Francisco | San Francisco, CA, USA | APPROXIMATE | 1 | | ||
| 94107, San Francisco | San Francisco, CA 94107, USA | APPROXIMATE | 1 | | ||
| 94107, California | San Francisco, CA 94107, USA | APPROXIMATE | 1 | | ||
| Co Road 182 | Co Rd 182, Bennett, CO 80102, USA | GEOMETRIC_CENTER | 9 | | ||
| Andalucia | Andalusia, Spain | APPROXIMATE | 1 | | ||
| Spain A42 | A-42, Spain | GEOMETRIC_CENTER | 1 | | ||
| Interstate 280 | I-280, California, USA | GEOMETRIC_CENTER | 1 | | ||
|
||
Scenario: several responses | ||
When I successfully browse to the url | ||
| parameter | value | | ||
| address | Calle Real | | ||
| components | country:Spain | | ||
And I see 'GEOMETRIC_CENTER' response contains a formatted_address 'Calle Real, San Sebastián de los Reyes, Madrid, Spain' | ||
And I see all results contains an address_component | ||
| type | attribute | value | | ||
| country | short_name | ES | | ||
|
||
Scenario Outline: several address | ||
When I successfully browse to the url | ||
| parameter | value | | ||
| address | <address> | | ||
| components | administrative_area:Huelva\|country:Spain | | ||
Then I see response with status 'OK' | ||
And I see 1 result in the response | ||
And I see first response formatted_address '<formatted_address>' | ||
And I see first response contains an address_component | ||
| type | attribute | value | | ||
| administrative_area_level_2 | short_name | Huelva | | ||
And I see first response contains 'GEOMETRIC_CENTER' geographic coordinates | ||
|
||
Examples: | ||
| address | formatted_address | | ||
| calle 6 Mozarabes \| calle puerto | Calle Puerto, Huelva, Spain | | ||
| calle puerto \| calle los mozarabes | Calle los Mozárabes, 21002 Huelva, Spain | | ||
|
||
Scenario: several address | ||
When I successfully browse to the url | ||
| parameter | value | | ||
| address | calle 6 Mozarabes | | ||
| address | calle puerto | | ||
| components | administrative_area:Huelva\|country:Spain | | ||
Then I see response with status 'OK' | ||
And I see 1 result in the response | ||
And I see first response formatted_address 'Huelva, Spain' | ||
And I see first response contains an address_component | ||
| type | attribute | value | | ||
| administrative_area_level_2 | short_name | Huelva | | ||
And I see first response contains 'APPROXIMATE' geographic coordinates | ||
|
||
Scenario: region additional parameters | ||
When I successfully browse to the url | ||
| parameter | value | | ||
| address | 1025 Los Mozarabes | | ||
| components | administrative_area:Huelva\|country:Spain | | ||
Then I see response with status 'OK' | ||
And I see 1 result in the response | ||
And I see first results is partial_match | ||
And I see first response formatted_address 'Calle los Mozárabes, 21002 Huelva, Spain' |
Oops, something went wrong.