Skip to content

Commit

Permalink
Switch CI from Travis to CircleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
Diasporism authored and sarahsehr committed Jul 6, 2023
1 parent 8cd0aa1 commit e90b9d7
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 50 deletions.
111 changes: 111 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
version: 2.1

orbs:
gem-tool: appfolio/gem-tool@volatile

commands:
install_dependencies:
steps:
- run:
name: Update Package Lists
command: sudo apt-get update
- run:
name: Install wget libgtk-3-dev libxt-dev libdbus-glib-1-2
command: sudo apt-get install wget libgtk-3-dev libxt-dev libdbus-glib-1-2
- restore_cache:
# need to update cache key when you bump version of geckodriver and firefox
key: v1-geckodriver-0.32.1-firefox-111.0
- run:
name: Install geckodriver
command: |
wget https://github.com/mozilla/geckodriver/releases/download/v0.32.1/geckodriver-v0.32.1-linux64.tar.gz
tar -zxvf geckodriver-v0.32.1-linux64.tar.gz
sudo mv geckodriver /usr/bin
rm -rf geckodriver-v0.32.1-linux64.tar.gz
- run:
name: Install firefox
command: |
wget https://ftp.mozilla.org/pub/firefox/releases/111.0/linux-x86_64/en-US/firefox-111.0.tar.bz2
tar xvjf firefox-111.0.tar.bz2
sudo mv firefox /usr/local/firefox
sudo ln -s /usr/local/firefox/firefox /usr/bin/firefox
firefox -v
rm -rf firefox-111.0.tar.bz2
- save_cache:
# need to update cache key when you bump version of geckodriver and firefox
key: v1-geckodriver-0.32.1-firefox-111.0
paths:
- ./bin
- ./firefox
- run:
name: set PATH to include geckodriver and firefox
command: echo 'export PATH=$HOME/project/firefox:$HOME/project/bin:$PATH' >> $BASH_ENV

workflows:
rc:
jobs:
- gem-tool/rake_test:
name: test_ruby-<< matrix.ruby_version >>_rails_60
context: appfolio_test_context
executor_tag: ruby
matrix:
environment:
RAILS_VERSION: "6.0"
parameters:
ruby_version:
- "2.7.5"
- "2.7.7"
after-checkout-steps:
- install_dependencies
after-appraisal-install-steps:
- run:
name: Install CI Dependencies
command: bundle exec rake test:ci:install
- run:
name: Run CI Tests
command: bundle exec rake test:ci
- gem-tool/rake_test:
name: test_ruby-<< matrix.ruby_version >>_rails_61
context: appfolio_test_context
executor_tag: ruby
matrix:
environment:
RAILS_VERSION: "6.1"
parameters:
ruby_version:
- "3.2.1"
- "3.1.3"
- "3.0.6"
- "2.7.7"
- "2.7.5"
after-checkout-steps:
- install_dependencies
after-appraisal-install-steps:
- run:
name: Install CI Dependencies
command: bundle exec rake test:ci:install
- run:
name: Run CI Tests
command: bundle exec rake test:ci
- gem-tool/rake_test:
name: test_ruby-<< matrix.ruby_version >>_rails_70
context: appfolio_test_context
executor_tag: ruby
matrix:
environment:
RAILS_VERSION: "7.0"
parameters:
ruby_version:
- "3.2.1"
- "3.1.3"
- "3.0.6"
- "2.7.7"
after-checkout-steps:
- install_dependencies
after-appraisal-install-steps:
- run:
name: Install CI Dependencies
command: bundle exec rake test:ci:install
- run:
name: Run CI Tests
command: bundle exec rake test:ci
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

29 changes: 14 additions & 15 deletions development.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Development

This page documents how to make changes to AePageObjects including running the test suite.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
Expand Down Expand Up @@ -36,23 +36,23 @@ Generally, internal correctness is verified via _unit tests_ and correctness wit

Unit tests run against every version of Capybara _at most once_ and against both the minimum and maximum Ruby version _at least once_.

Integration tests run against every version of Rails at least once and every version of Capybara at least once.
Integration tests run against every version of Rails at least once and every version of Capybara at least once.

## Dependencies

AePageObjects is tested across various versions of Capybara, Ruby, and Rails.
AePageObjects is tested across various versions of Capybara, Ruby, and Rails.

### Supported Capybara versions

AePageObjects aims to support all recent versions of Capybara. The currently supported versions of Capybara are listed
in the gemspec.

### Supported Ruby versions

AePageObjects supports the same minimum Ruby version as Capybara. The minimum Ruby version
is specified in the gemspec.

The test suite tests against the minimum version and a designated maximum version, specified in `.travis.yml`.
The test suite tests against the minimum version and a designated maximum version, specified in `.circle/config.yml`.

### Supported Rails versions

Expand All @@ -61,11 +61,10 @@ the built-in Rails router for resolving path declarations.

The router support is tested against various Rails versions matching versioned directories in _test/test_apps_.


## Implementation

Tests are run using rake tasks defined in the Rakefile. The rake tasks use [Appraisals](https://github.com/thoughtbot/appraisal)
for running integration tests across versions of dependencies. The test suite run by Travis CI is defined in `.travis.yml`,
for running integration tests across versions of dependencies. The test suite run by CircleCI is defined in `.circleci/config.yml`,
which specifies various ENV variables that the tasks defined in Rakefile use to select tests to run.

### Appraisals
Expand All @@ -77,13 +76,13 @@ files in the _test/test_apps_ directories are used for running integration tests
## Unit tests

The unit tests are stored in the _test/unit_ directory. To run the unit tests:

```
bundle install
rake test:units
```

This will run the unit tests for the current version of Ruby using the Capybara version from the Gemfile.lock file.
This will run the unit tests for the current version of Ruby using the Capybara version from the Gemfile.lock file.

## Integration tests

Expand All @@ -93,7 +92,7 @@ There are 2 types of integration tests:

1. Ruby-only unit tests that run against different versions.
2. Selenium tests that make use of page objects written via AePageObjects and run against a Rails application.

### Capybara

#### Units
Expand All @@ -108,7 +107,7 @@ rake test:integration:units:install
rake test:integration:units
```

The tests run by the above commands generally stub/mock out Capybara. Running these tests against multiple versions of Capybara verifies
The tests run by the above commands generally stub/mock out Capybara. Running these tests against multiple versions of Capybara verifies
that the stub/mock setup within the tests works across Capybara versions.

#### Integration
Expand Down Expand Up @@ -138,8 +137,8 @@ rake test:units

`AePageObjects::ApplicationRouter` is tested against various versions of Rails in the _test/test_apps_ directory (currently 3.0 to 5.0).
These tests use the most recent Ruby and Capybara versions possible for the version of Rails.
To run the integration tests against a specific version of Rails:

To run the integration tests against a specific version of Rails:

```
RAILS_VERSION=6.0 rake test:integration:selenium:install
Expand All @@ -148,7 +147,7 @@ RAILS_VERSION=6.0 rake test:integration:selenium

## CI

The test suite is run on Travis CI via the `.travis.yml` config, which uses the `test:ci` and `test:ci:install` rake tasks. To run these
The test suite is run on CircleCI via the `.circleci/config.yml` config, which uses the `test:ci` and `test:ci:install` rake tasks. To run these
locally using the current Ruby version:

```
Expand Down

0 comments on commit e90b9d7

Please sign in to comment.