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

Add support for samples in circle-ci #140

Draft
wants to merge 38 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
35c8d55
Start CircleCI integration
vincent-psarga Jul 24, 2019
ee9ded5
Add CircleCI badge
vincent-psarga Jul 24, 2019
14b1fea
Add JUnit formatter gem
vincent-psarga Jul 24, 2019
3176cad
Debugging for Circle CI
vincent-psarga Jul 24, 2019
34006cb
Revert previous commit
vincent-psarga Jul 24, 2019
5bffab7
Test another Ruby version
vincent-psarga Jul 24, 2019
d9d1e2c
Try workflows to run on multiple ruby versions
vincent-psarga Jul 24, 2019
977eeec
Fix typos in circle ci config
vincent-psarga Jul 24, 2019
3573dde
Try second workflow to run hps tests too
vincent-psarga Jul 29, 2019
4a5c3cf
Regenerate samples for behat before running them
vincent-psarga Jul 29, 2019
4b65051
Checkout repo before installing ...
vincent-psarga Jul 29, 2019
907ff13
Split hiptest publisher install and use bundle for rake
vincent-psarga Jul 29, 2019
4ed5733
Try caching gems to share publisher between jobs
vincent-psarga Jul 29, 2019
01c433d
use force on buncle clean
vincent-psarga Jul 29, 2019
9d17ea9
Try gem caching between samples jobs
vincent-psarga Jul 29, 2019
d33a6ac
Run checkout before so Gemfile is available
vincent-psarga Jul 29, 2019
e5ad6b8
Recover gems before installing publisher
vincent-psarga Jul 29, 2019
e45e671
Run hps-behave tests
vincent-psarga Jul 29, 2019
87e7fa8
Forgot indentation for regenerate tests command
vincent-psarga Jul 29, 2019
2b5c6ce
Run tests in correct directory
vincent-psarga Jul 29, 2019
c718616
Run hps-python-unittest
vincent-psarga Jul 29, 2019
887ef98
Add support for java based samples
vincent-psarga Jul 29, 2019
efc43f8
Add support for jbehave
vincent-psarga Jul 29, 2019
c376951
Use make to simplify running hps
vincent-psarga Jul 30, 2019
a2dd049
Add qUnit and Jasmine in CI
vincent-psarga Jul 31, 2019
9b44be5
Add some more smaples to run
vincent-psarga Aug 2, 2019
7cbaa52
Try to use default image to run samples
vincent-psarga Sep 26, 2019
a93647e
Fix copy/paste
vincent-psarga Sep 26, 2019
4261216
Disable samples with old method
vincent-psarga Sep 26, 2019
2239fb9
Use sudo to add bundler
vincent-psarga Sep 26, 2019
0140893
Specify version of bundler for samples
vincent-psarga Sep 26, 2019
5f576f0
Also use sudo to install hiptest-publisher
vincent-psarga Sep 26, 2019
8bcaacb
Ensure pre-requisites are installed
vincent-psarga Sep 26, 2019
6beaef9
Fix CircleCI config
vincent-psarga Sep 26, 2019
ea58a80
Install pre-requisites in the correct repository ...
vincent-psarga Sep 26, 2019
691c14e
Add pre-requisites without sudo
vincent-psarga Sep 26, 2019
7d88619
Try cucumber-ruby with new workflow
vincent-psarga Sep 26, 2019
d201dfc
Try different docker image to run hps-cucumber-ruby
vincent-psarga Sep 30, 2019
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
373 changes: 373 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,373 @@
version: 2.1

commands:
#############################################################################
# Hiptest publisher CI jobs #
#############################################################################

build_and_test:
description: "Build and run the tests"
parameters:
output_dir:
type: string
default: ""
steps:
- checkout
- run:
name: install dependencies
command: |
bundle install --jobs=4 --retry=3 --path vendor/bundle

- run:
name: run tests
command: |
mkdir /tmp/test-results/<< parameters.output_dir >>
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | \
circleci tests split --split-by=timings)"

bundle exec rspec \
--format progress \
--format RspecJunitFormatter \
--out /tmp/test-results/<< parameters.output_dir >>/rspec.xml \
--format progress \
$TEST_FILES

- store_test_results:
path: /tmp/test-results/<< parameters.output_dir >>

restore_bundler_cache:
description: "Restore cached gems"
steps:
- restore_cache:
keys:
# when lock file changes, use increasingly general patterns to restore cache
- v1-gem-cache-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
- v1-gem-cache-{{ arch }}-{{ .Branch }}-
- v1-gem-cache-{{ arch }}-

install_ruby:
description: "Install Ruby"
steps:
- run:
name: Install Ruby
command: |
sudo apt-get update
sudo apt-get install ruby ruby-dev
sudo gem install bundler -v 1.17.3

install_hiptest_publisher:
description: "Install Hiptest publisher"
steps:
- run:
name: Install hiptest-publisher
command: |
bundle install
sudo bundle exec rake install

run_sample:
description: "Run hps repo with local hiptest-publisher"
parameters:
project_path:
type: string
default: ""
steps:
- checkout
- install_ruby
- install_hiptest_publisher
- run:
name: Checkout and run sample
command: |
mkdir -p hps
pushd hps
git clone https://github.com/hiptest/<< parameters.project_path >>
pushd << parameters.project_path >>
make install_prerequisites
make generate_tests
make test

jobs:
build-ruby-2_3:
docker:
- image: circleci/ruby:2.3.8

working_directory: ~/repo
steps:
- build_and_test:
output_dir: "2.3"

build-ruby-2_4:
docker:
- image: circleci/ruby:2.4.5

working_directory: ~/repo
steps:
- build_and_test:
output_dir: "2.4"

build-ruby-2_5:
docker:
- image: circleci/ruby:2.5.5

working_directory: ~/repo
steps:
- build_and_test:
output_dir: "2.5"

build-ruby-2_6:
docker:
- image: circleci/ruby:2.6.2

working_directory: ~/repo
steps:
- build_and_test:
output_dir: "2.6"

#############################################################################
# Hiptest publisher samples jobs #
#############################################################################

hps-behat:
docker:
- image: circleci/php:7.2
working_directory: ~/repo

steps:
- run_sample:
project_path: "hps-behat"

hps-behave:
docker:
- image: circleci/python:2.7
working_directory: ~/repo

steps:
- run_sample:
project_path: "hps-behave"

hps-cucumber-ruby:
docker:
- image: circleci/ruby:2.6.2
working_directory: ~/repo

steps:
- run_sample:
project_path: "hps-cucumber-ruby"

hps-cucumber-groovy:
docker:
- image: hiptest/hiptest-publisher-samples
working_directory: ~/repo

steps:
- regenerate_and_run_tests:
project_path: "hps-cucumber-groovy"

hps-cucumber-java:
docker:
- image: hiptest/hiptest-publisher-samples
working_directory: ~/repo

steps:
- regenerate_and_run_tests:
project_path: "hps-cucumber-java"

hps-cucumber-javascript:
docker:
- image: hiptest/hiptest-publisher-samples
working_directory: ~/repo

steps:
- regenerate_and_run_tests:
project_path: "hps-cucumber-javascript"

hps-cucumber-typescript:
docker:
- image: hiptest/hiptest-publisher-samples
working_directory: ~/repo

steps:
- regenerate_and_run_tests:
project_path: "hps-cucumber-typescript"

hps-groovy-spock:
docker:
- image: hiptest/hiptest-publisher-samples
working_directory: ~/repo

steps:
- regenerate_and_run_tests:
project_path: "hps-groovy-spock"

hps-java-junit:
docker:
- image: hiptest/hiptest-publisher-samples
working_directory: ~/repo

steps:
- regenerate_and_run_tests:
project_path: "hps-java-junit"

hps-java-testng:
docker:
- image: hiptest/hiptest-publisher-samples
working_directory: ~/repo

steps:
- regenerate_and_run_tests:
project_path: "hps-java-testng"

hps-javascript-jasmine:
docker:
- image: hiptest/hiptest-publisher-samples
working_directory: ~/repo

steps:
- regenerate_and_run_tests:
project_path: "hps-javascript-jasmine"

hps-javascript-mocha:
docker:
- image: hiptest/hiptest-publisher-samples
working_directory: ~/repo

steps:
- regenerate_and_run_tests:
project_path: "hps-javascript-mocha"

hps-javascript-qunit:
docker:
- image: hiptest/hiptest-publisher-samples
working_directory: ~/repo

steps:
- regenerate_and_run_tests:
project_path: "hps-javascript-qunit"

hps-jbehave:
docker:
- image: hiptest/hiptest-publisher-samples
working_directory: ~/repo

steps:
- regenerate_and_run_tests:
project_path: "hps-jbehave"

hps-protractor:
docker:
- image: hiptest/hiptest-publisher-samples
working_directory: ~/repo

steps:
- regenerate_and_run_tests:
project_path: "hps-protractor"

hps-python-unittest:
docker:
- image: hiptest/hiptest-publisher-samples
working_directory: ~/repo

steps:
- regenerate_and_run_tests:
project_path: "hps-python-unittest"

hps-robotframework:
docker:
- image: hiptest/hiptest-publisher-samples
working_directory: ~/repo

steps:
- regenerate_and_run_tests:
project_path: "hps-robotframework"

hps-ruby-minitest:
docker:
- image: hiptest/hiptest-publisher-samples
working_directory: ~/repo

steps:
- regenerate_and_run_tests:
project_path: "hps-ruby-minitest"

hps-ruby-rspec:
docker:
- image: hiptest/hiptest-publisher-samples
working_directory: ~/repo

steps:
- regenerate_and_run_tests:
project_path: "hps-ruby-rspec"

workflows:
version: 2
# build:
# jobs:
# - build-ruby-2_3
# - build-ruby-2_4
# - build-ruby-2_5
# - build-ruby-2_6

run_samples:
jobs:
- hps-behat
- hps-behave
- hps-cucumber-ruby

# - hps-cucumber-ruby:
# requires:
# - install-hiptest-publisher

# - hps-cucumber-groovy:
# requires:
# - install-hiptest-publisher

# - hps-cucumber-java:
# requires:
# - install-hiptest-publisher

# - hps-cucumber-javascript:
# requires:
# - install-hiptest-publisher

# - hps-cucumber-typescript:
# requires:
# - install-hiptest-publisher

# - hps-groovy-spock:
# requires:
# - install-hiptest-publisher

# - hps-java-junit:
# requires:
# - install-hiptest-publisher

# - hps-java-testng:
# requires:
# - install-hiptest-publisher

# - hps-javascript-mocha:
# requires:
# - install-hiptest-publisher

# - hps-jbehave:
# requires:
# - install-hiptest-publisher

# - hps-protractor:
# requires:
# - install-hiptest-publisher

# - hps-python-unittest:
# requires:
# - install-hiptest-publisher

# - hps-robotframework:
# requires:
# - install-hiptest-publisher

# - hps-ruby-minitest:
# requires:
# - install-hiptest-publisher

# - hps-ruby-rspec:
# requires:
# - install-hiptest-publisher
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

# Ignore gem
/*.gem
/hps-cucumber-groovy/target/

# Ignore Mac files
.DS_Store

vendor
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ end

group :test do
gem 'webmock'
gem 'rspec_junit_formatter'
end
Loading