Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Parallelize CI, update run-int task #344

Merged
merged 2 commits into from
May 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 81 additions & 1 deletion ci/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jobs:
- name: pr-integrate
- name: integration-tests-compute
plan:
- get: fog-google-src
resource: pull-request
Expand All @@ -11,9 +11,89 @@ jobs:
- task: full-integration-tests
file: fog-google-src/ci/tasks/run-int.yml
params:
rake_task: test:compute
google_project: {{google_project}}
google_json_key_data: {{google_json_key_data}}
google_client_email: {{google_client_email}}

- name: integration-tests-monitoring
plan:
- get: fog-google-src
resource: pull-request
version: every
trigger: true
- put: pull-request
params: {path: fog-google-src, status: pending}

- task: full-integration-tests
file: fog-google-src/ci/tasks/run-int.yml
params:
rake_task: test:monitoring
google_project: {{google_project}}
google_json_key_data: {{google_json_key_data}}
google_client_email: {{google_client_email}}

- name: integration-tests-pubsub
plan:
- get: fog-google-src
resource: pull-request
version: every
trigger: true
- put: pull-request
params: {path: fog-google-src, status: pending}

- task: full-integration-tests
file: fog-google-src/ci/tasks/run-int.yml
params:
rake_task: test:pubsub
google_project: {{google_project}}
google_json_key_data: {{google_json_key_data}}
google_client_email: {{google_client_email}}

- name: integration-tests-sql
plan:
- get: fog-google-src
resource: pull-request
version: every
trigger: true
- put: pull-request
params: {path: fog-google-src, status: pending}

- task: full-integration-tests
file: fog-google-src/ci/tasks/run-int.yml
params:
rake_task: test:sql
google_project: {{google_project}}
google_json_key_data: {{google_json_key_data}}
google_client_email: {{google_client_email}}

- name: integration-tests-storage
plan:
- get: fog-google-src
resource: pull-request
version: every
trigger: true
- put: pull-request
params: {path: fog-google-src, status: pending}

- task: full-integration-tests
file: fog-google-src/ci/tasks/run-int.yml
params:
rake_task: test:storage
google_project: {{google_project}}
google_json_key_data: {{google_json_key_data}}
google_client_email: {{google_client_email}}

- name: github-pr-aggregator
plan:
- get: fog-google-src
resource: pull-request
passed: [integration-tests-storage,
integration-tests-sql,
integration-tests-pubsub,
integration-tests-monitoring,
integration-tests-compute]
trigger: true
on_success:
put: pull-request
params:
Expand Down
3 changes: 2 additions & 1 deletion ci/tasks/run-int.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ popd > /dev/null
check_param google_project
check_param google_client_email
check_param google_json_key_data
check_param rake_task

echo $google_json_key_data > `pwd`/service_account_key.json

Expand All @@ -29,6 +30,6 @@ pushd ${release_dir} > /dev/null

bundle install

FOG_MOCK=false rake test
FOG_MOCK=false rake ${rake_task}

popd > /dev/null
1 change: 1 addition & 0 deletions ci/tasks/run-int.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ inputs:
run:
path: src/fog-google/ci/tasks/run-int.sh
params:
rake_task: replace-me
google_project: replace-me
google_client_email: replace-me
google_json_key_data: |
Expand Down
27 changes: 12 additions & 15 deletions tasks/test.rake
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
require "rake/testtask"

Rake::TestTask.new do |t|
t.libs << "test"
t.pattern = File.join("test", "**", "test_*.rb")
t.warning = false
end

Rake::TestTask.new do |t|
t.name = "compute"
t.description = "Run all integration tests"
t.libs << "test"
t.pattern = File.join("test", "**", "test_*.rb")
t.warning = false
Expand All @@ -19,8 +13,15 @@ namespace :test do
sh("export FOG_MOCK=#{mock} && bundle exec shindont")
end

desc "Run all integration tests in parallel"
multitask :parallel => ["test:compute",
"test:monitoring",
"test:pubsub",
"test:sql",
"test:storage"]
Rake::TestTask.new do |t|
t.name = "compute"
t.description = "Run Compute API tests"
t.libs << "test"
t.pattern = FileList['test/integration/compute/test_*.rb']
t.warning = false
Expand All @@ -29,6 +30,7 @@ namespace :test do

Rake::TestTask.new do |t|
t.name = "monitoring"
t.description = "Run Monitoring API tests"
t.libs << "test"
t.pattern = FileList['test/integration/monitoring/test_*.rb']
t.warning = false
Expand All @@ -37,14 +39,7 @@ namespace :test do

Rake::TestTask.new do |t|
t.name = "pubsub"
t.libs << "test"
t.pattern = FileList['test/integration/monitoring/test_*.rb']
t.warning = false
t.verbose = true
end

Rake::TestTask.new do |t|
t.name = "pubsub"
t.description = "Run PubSub API tests"
t.libs << "test"
t.pattern = FileList['test/integration/pubsub/test_*.rb']
t.warning = false
Expand All @@ -53,6 +48,7 @@ namespace :test do

Rake::TestTask.new do |t|
t.name = "sql"
t.description = "Run SQL API tests"
t.libs << "test"
t.pattern = FileList['test/integration/sql/test_*.rb']
t.warning = false
Expand All @@ -61,6 +57,7 @@ namespace :test do

Rake::TestTask.new do |t|
t.name = "storage"
t.description = "Run Storage API tests"
t.libs << "test"
t.pattern = FileList['test/integration/storage/test_*.rb']
t.warning = false
Expand Down