pig-ci-rails 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.dockerignore +58 -0
- data/.env +3 -0
- data/.github/workflows/changelog.yml +38 -0
- data/.github/workflows/gempush.yml +1 -1
- data/.github/workflows/linters.yml +78 -0
- data/.github/workflows/rspec.yml +40 -0
- data/.rubocop.yml +5 -12
- data/.ruby-version +1 -1
- data/.travis.yml +3 -3
- data/Aptfile +0 -0
- data/CHANGELOG.md +105 -31
- data/Dockerfile +45 -0
- data/README.md +20 -0
- data/docker-compose.yml +20 -0
- data/lib/pig_ci.rb +14 -0
- data/lib/pig_ci/profiler_engine/rails.rb +8 -6
- data/lib/pig_ci/test_frameworks.rb +3 -0
- data/lib/pig_ci/test_frameworks/rspec.rb +20 -0
- data/lib/pig_ci/version.rb +1 -1
- data/lib/pig_ci/views/index.erb +3 -1
- data/pig_ci.gemspec +2 -2
- metadata +14 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 714476e6ae0470b4a01ce46c8740940a430bf42df5b5ef6d5cbd844b6cd85f1f
|
4
|
+
data.tar.gz: af4e6841d07731b8ed8766930505ecfd5e08d6dd2ae71090dc12068999874417
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0734e4ecd7a8c643bfb5e0e07305a15f9db93e9ad10ec28eb46e7b9d64d5faad64aa33cf7e93a23f920d96967670b2db2e05916408c5445a4c7b09645679fe35
|
7
|
+
data.tar.gz: fa1b4af97289153edfc63979d3811890684980d54e24e1f224946e4e0dc9d72cc3cdaa9954343b589020478c1860dc952bb70361459058e4f6d817cc5a47ff20
|
data/.dockerignore
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
.git
|
2
|
+
.gitignore
|
3
|
+
README.md
|
4
|
+
|
5
|
+
#
|
6
|
+
# OS X
|
7
|
+
#
|
8
|
+
.DS_Store
|
9
|
+
.AppleDouble
|
10
|
+
.LSOverride
|
11
|
+
# Icon must end with two \r
|
12
|
+
Icon
|
13
|
+
# Thumbnails
|
14
|
+
._*
|
15
|
+
# Files that might appear on external disk
|
16
|
+
.Spotlight-V100
|
17
|
+
.Trashes
|
18
|
+
# Directories potentially created on remote AFP share
|
19
|
+
.AppleDB
|
20
|
+
.AppleDesktop
|
21
|
+
Network Trash Folder
|
22
|
+
Temporary Items
|
23
|
+
.apdisk
|
24
|
+
|
25
|
+
#
|
26
|
+
# Rails
|
27
|
+
#
|
28
|
+
.env.sample
|
29
|
+
*.rbc
|
30
|
+
capybara-*.html
|
31
|
+
log
|
32
|
+
tmp
|
33
|
+
db/*.sqlite3
|
34
|
+
db/*.sqlite3-journal
|
35
|
+
public/system
|
36
|
+
public/assets
|
37
|
+
public/packs
|
38
|
+
public/packs-test
|
39
|
+
node_modules
|
40
|
+
yarn-error.log
|
41
|
+
yarn-debug.log*
|
42
|
+
.yarn-integrity
|
43
|
+
external_dns.log
|
44
|
+
|
45
|
+
coverage/
|
46
|
+
spec/tmp
|
47
|
+
**.orig
|
48
|
+
|
49
|
+
.bundle
|
50
|
+
|
51
|
+
.ruby-gemset
|
52
|
+
|
53
|
+
.rvmrc
|
54
|
+
|
55
|
+
# if using bower-rails ignore default bower_components path bower.json files
|
56
|
+
vendor/assets/bower_components
|
57
|
+
*.bowerrc
|
58
|
+
bower.json
|
@@ -0,0 +1,38 @@
|
|
1
|
+
name: Changelog
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
build:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
timeout-minutes: 4
|
12
|
+
if: "!contains(github.event.head_commit.message, '[nodoc]')"
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@master
|
15
|
+
- name: Set up Ruby 2.6
|
16
|
+
uses: actions/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: 2.6.x
|
19
|
+
- uses: actions/cache@v1.1.2
|
20
|
+
with:
|
21
|
+
path: vendor/bundle
|
22
|
+
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
23
|
+
restore-keys: |
|
24
|
+
${{ runner.os }}-gem-
|
25
|
+
- name: Create local changes
|
26
|
+
run: |
|
27
|
+
gem install github_changelog_generator
|
28
|
+
github_changelog_generator -u PigCI -p pig-ci-rails --token ${{ secrets.GITHUB_TOKEN }} --exclude-labels duplicate,question,invalid,wontfix,nodoc
|
29
|
+
- name: Commit files
|
30
|
+
run: |
|
31
|
+
git config --local user.email "github-actions@example.com"
|
32
|
+
git config --local user.name "GitHub Actions"
|
33
|
+
git commit -m "[nodoc] update changelog" -a
|
34
|
+
- name: Push changes
|
35
|
+
uses: ad-m/github-push-action@master
|
36
|
+
with:
|
37
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
38
|
+
|
@@ -0,0 +1,78 @@
|
|
1
|
+
---
|
2
|
+
name: Linters
|
3
|
+
|
4
|
+
on:
|
5
|
+
pull_request:
|
6
|
+
branches: [ master ]
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
dotenv:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v1
|
13
|
+
- name: dotenv-linter
|
14
|
+
uses: wemake-services/dotenv-linter@0.1.5
|
15
|
+
with:
|
16
|
+
reporter: 'github-pr-review'
|
17
|
+
options: '.env'
|
18
|
+
env:
|
19
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
20
|
+
rubocop:
|
21
|
+
runs-on: ubuntu-latest
|
22
|
+
steps:
|
23
|
+
- uses: actions/checkout@v1
|
24
|
+
- name: Rubocop Linter Action
|
25
|
+
uses: andrewmcodes/rubocop-linter-action@v3.1.0
|
26
|
+
env:
|
27
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
28
|
+
languagetool:
|
29
|
+
runs-on: ubuntu-latest
|
30
|
+
steps:
|
31
|
+
- uses: actions/checkout@v2
|
32
|
+
- uses: reviewdog/action-languagetool@v1
|
33
|
+
with:
|
34
|
+
github_token: ${{ secrets.github_token }}
|
35
|
+
# Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review].
|
36
|
+
reporter: github-pr-review
|
37
|
+
# Change reporter level if you need.
|
38
|
+
level: info
|
39
|
+
hadolint:
|
40
|
+
runs-on: ubuntu-latest
|
41
|
+
steps:
|
42
|
+
- name: Check out code
|
43
|
+
uses: actions/checkout@v1
|
44
|
+
- name: hadolint
|
45
|
+
uses: reviewdog/action-hadolint@v1
|
46
|
+
with:
|
47
|
+
github_token: ${{ secrets.github_token }}
|
48
|
+
reporter: github-pr-review
|
49
|
+
fasterer:
|
50
|
+
runs-on: ubuntu-latest
|
51
|
+
steps:
|
52
|
+
- name: Check out code
|
53
|
+
uses: actions/checkout@v1
|
54
|
+
- name: fasterer
|
55
|
+
uses: vk26/action-fasterer@v1
|
56
|
+
with:
|
57
|
+
github_token: ${{ secrets.github_token }}
|
58
|
+
reporter: github-pr-review
|
59
|
+
stylelint:
|
60
|
+
runs-on: ubuntu-latest
|
61
|
+
steps:
|
62
|
+
- uses: actions/checkout@v1
|
63
|
+
- name: stylelint
|
64
|
+
uses: reviewdog/action-stylelint@v1
|
65
|
+
with:
|
66
|
+
github_token: ${{ secrets.github_token }}
|
67
|
+
reporter: github-pr-review
|
68
|
+
stylelint_input: '**/*.css'
|
69
|
+
eslint:
|
70
|
+
runs-on: ubuntu-latest
|
71
|
+
steps:
|
72
|
+
- uses: actions/checkout@v1
|
73
|
+
- name: eslint
|
74
|
+
uses: reviewdog/action-eslint@v1
|
75
|
+
with:
|
76
|
+
github_token: ${{ secrets.github_token }}
|
77
|
+
reporter: github-pr-review
|
78
|
+
eslint_flags: 'app/'
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
name: RSpec
|
3
|
+
|
4
|
+
on:
|
5
|
+
push:
|
6
|
+
branches: [ master ]
|
7
|
+
pull_request:
|
8
|
+
branches: [ master ]
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
build:
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v1
|
16
|
+
|
17
|
+
- name: Set up Ruby 2.6
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: 2.6.6
|
21
|
+
|
22
|
+
- uses: actions/cache@v1
|
23
|
+
with:
|
24
|
+
path: vendor/bundle
|
25
|
+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
26
|
+
restore-keys: |
|
27
|
+
${{ runner.os }}-gems-
|
28
|
+
|
29
|
+
- name: Build
|
30
|
+
env:
|
31
|
+
RAILS_ENV: test
|
32
|
+
run: |
|
33
|
+
gem install bundler
|
34
|
+
bundle config path vendor/bundle
|
35
|
+
bundle install --jobs 4 --retry 3
|
36
|
+
- name: Run tests
|
37
|
+
env:
|
38
|
+
RAILS_ENV: test
|
39
|
+
run: |
|
40
|
+
bundle exec rake spec
|
data/.rubocop.yml
CHANGED
@@ -1,24 +1,17 @@
|
|
1
|
+
---
|
1
2
|
AllCops:
|
2
3
|
Exclude:
|
4
|
+
- db/schema.rb
|
5
|
+
- 'node_modules/**/*'
|
6
|
+
- 'vendor/**/*'
|
3
7
|
- '.git/**/*'
|
4
8
|
- 'bin/*'
|
5
9
|
|
6
10
|
Style/FrozenStringLiteralComment:
|
7
11
|
EnforcedStyle: never
|
8
12
|
|
9
|
-
|
10
|
-
EnforcedStyle: context_dependent
|
11
|
-
|
12
|
-
Metrics/LineLength:
|
13
|
+
Layout/LineLength:
|
13
14
|
Max: 120
|
14
15
|
|
15
|
-
Metrics/BlockLength:
|
16
|
-
CountComments: true
|
17
|
-
Max: 25
|
18
|
-
ExcludedMethods: []
|
19
|
-
Exclude:
|
20
|
-
- "spec/**/*"
|
21
|
-
- '*.gemspec'
|
22
|
-
|
23
16
|
Style/ClassAndModuleChildren:
|
24
17
|
EnforcedStyle: compact
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.6.
|
1
|
+
2.6.6
|
data/.travis.yml
CHANGED
@@ -9,11 +9,11 @@ rvm:
|
|
9
9
|
- 2.3.8
|
10
10
|
- 2.4.7
|
11
11
|
- 2.5.7
|
12
|
-
- 2.6.
|
13
|
-
- 2.7.
|
12
|
+
- 2.6.6
|
13
|
+
- 2.7.1
|
14
14
|
|
15
15
|
before_install:
|
16
|
-
- gem install bundler -v 2.0.
|
16
|
+
- gem install bundler -v 2.0.2
|
17
17
|
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
18
18
|
- chmod +x ./cc-test-reporter
|
19
19
|
- ./cc-test-reporter before-build
|
data/Aptfile
ADDED
File without changes
|
data/CHANGELOG.md
CHANGED
@@ -1,53 +1,127 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
##
|
3
|
+
## [Unreleased](https://github.com/PigCI/pig-ci-rails/tree/HEAD)
|
4
4
|
|
5
|
-
|
5
|
+
[Full Changelog](https://github.com/PigCI/pig-ci-rails/compare/v1.0.0...HEAD)
|
6
6
|
|
7
|
-
|
7
|
+
**Closed issues:**
|
8
8
|
|
9
|
-
|
9
|
+
- Ignore specific specs? [\#30](https://github.com/PigCI/pig-ci-rails/issues/30)
|
10
10
|
|
11
|
-
|
11
|
+
**Merged pull requests:**
|
12
12
|
|
13
|
-
|
13
|
+
- Fixing spelling in the gemspec [\#36](https://github.com/PigCI/pig-ci-rails/pull/36) ([MikeRogers0](https://github.com/MikeRogers0))
|
14
|
+
- Adding autogenerated changelog [\#35](https://github.com/PigCI/pig-ci-rails/pull/35) ([MikeRogers0](https://github.com/MikeRogers0))
|
15
|
+
- Fixing missing logo in output summary [\#34](https://github.com/PigCI/pig-ci-rails/pull/34) ([MikeRogers0](https://github.com/MikeRogers0))
|
16
|
+
- Add option to ignore cached SQL queries [\#33](https://github.com/PigCI/pig-ci-rails/pull/33) ([MikeRogers0](https://github.com/MikeRogers0))
|
17
|
+
- Skip tracking on specific tests via RSpec metadata [\#32](https://github.com/PigCI/pig-ci-rails/pull/32) ([MikeRogers0](https://github.com/MikeRogers0))
|
18
|
+
- Adding in Docker [\#31](https://github.com/PigCI/pig-ci-rails/pull/31) ([MikeRogers0](https://github.com/MikeRogers0))
|
19
|
+
- Publishing Package to PigCI account [\#28](https://github.com/PigCI/pig-ci-rails/pull/28) ([MikeRogers0](https://github.com/MikeRogers0))
|
14
20
|
|
15
|
-
|
21
|
+
## [v1.0.0](https://github.com/PigCI/pig-ci-rails/tree/v1.0.0) (2020-04-07)
|
16
22
|
|
17
|
-
|
23
|
+
[Full Changelog](https://github.com/PigCI/pig-ci-rails/compare/v0.2.2...v1.0.0)
|
18
24
|
|
19
|
-
|
20
|
-
* [Update rake requirement from ~> 12.3 to ~> 13.0](https://github.com/PigCI/pig-ci-rails/pull/14)
|
21
|
-
* [Update rspec requirement from ~> 3.8.0 to ~> 3.9.0](https://github.com/PigCI/pig-ci-rails/pull/16)
|
22
|
-
* [Update webmock requirement from ~> 3.7.0 to ~> 3.8.0](https://github.com/PigCI/pig-ci-rails/pull/17)
|
23
|
-
* [Adding config.thresholds, this allows standalone usage without pigci.com](https://github.com/PigCI/pig-ci-rails/pull/18) & [Replace references for limit to be threshold](https://github.com/PigCI/pig-ci-rails/pull/21)
|
24
|
-
* Setting up repo to publish gem when new tags are created.
|
25
|
+
**Merged pull requests:**
|
25
26
|
|
26
|
-
|
27
|
+
- Removing PigCI.com integration [\#27](https://github.com/PigCI/pig-ci-rails/pull/27) ([MikeRogers0](https://github.com/MikeRogers0))
|
27
28
|
|
28
|
-
|
29
|
+
## [v0.2.2](https://github.com/PigCI/pig-ci-rails/tree/v0.2.2) (2020-03-23)
|
29
30
|
|
30
|
-
|
31
|
+
[Full Changelog](https://github.com/PigCI/pig-ci-rails/compare/v0.2.1...v0.2.2)
|
31
32
|
|
32
|
-
|
33
|
+
**Merged pull requests:**
|
33
34
|
|
34
|
-
|
35
|
+
- Fixing grammar on post\_install\_message [\#25](https://github.com/PigCI/pig-ci-rails/pull/25) ([MikeRogers0](https://github.com/MikeRogers0))
|
35
36
|
|
36
|
-
|
37
|
-
* [Update webmock requirement from ~> 3.6.0 to ~> 3.7.0](https://github.com/PigCI/pig-ci-rails/pull/6)
|
37
|
+
## [v0.2.1](https://github.com/PigCI/pig-ci-rails/tree/v0.2.1) (2020-03-19)
|
38
38
|
|
39
|
-
|
39
|
+
[Full Changelog](https://github.com/PigCI/pig-ci-rails/compare/v0.2.0...v0.2.1)
|
40
40
|
|
41
|
-
|
42
|
-
* [Correcting issue where app warm up would negatively affect timezone](https://github.com/PigCI/pig-ci-rails/pull/5)
|
43
|
-
* [Adding option to control if app is preloaded or not](https://github.com/PigCI/pig-ci-rails/pull/3)
|
41
|
+
**Merged pull requests:**
|
44
42
|
|
45
|
-
|
43
|
+
- Stop GitHub actions not to run on commit [\#24](https://github.com/PigCI/pig-ci-rails/pull/24) ([MikeRogers0](https://github.com/MikeRogers0))
|
44
|
+
- Handling JSON response for API key being incorrect with correct error [\#23](https://github.com/PigCI/pig-ci-rails/pull/23) ([MikeRogers0](https://github.com/MikeRogers0))
|
46
45
|
|
47
|
-
|
48
|
-
* Adding fallback for if API is down to not fail CI.
|
49
|
-
* Removing unnecessary JS,
|
46
|
+
## [v0.2.0](https://github.com/PigCI/pig-ci-rails/tree/v0.2.0) (2020-03-18)
|
50
47
|
|
51
|
-
|
48
|
+
[Full Changelog](https://github.com/PigCI/pig-ci-rails/compare/v0.1.5...v0.2.0)
|
52
49
|
|
53
|
-
|
50
|
+
**Merged pull requests:**
|
51
|
+
|
52
|
+
- Using GitHubs example for gempush.yml [\#22](https://github.com/PigCI/pig-ci-rails/pull/22) ([MikeRogers0](https://github.com/MikeRogers0))
|
53
|
+
- Replace references for limit to be threshold [\#21](https://github.com/PigCI/pig-ci-rails/pull/21) ([MikeRogers0](https://github.com/MikeRogers0))
|
54
|
+
- Setting up for 0.2.0 release [\#20](https://github.com/PigCI/pig-ci-rails/pull/20) ([MikeRogers0](https://github.com/MikeRogers0))
|
55
|
+
- Adding in action for when I tag a new version [\#19](https://github.com/PigCI/pig-ci-rails/pull/19) ([MikeRogers0](https://github.com/MikeRogers0))
|
56
|
+
- Adding config.thresholds, this allows standalone usage without pigci.com [\#18](https://github.com/PigCI/pig-ci-rails/pull/18) ([MikeRogers0](https://github.com/MikeRogers0))
|
57
|
+
- Update webmock requirement from ~\> 3.7.0 to ~\> 3.8.0 [\#17](https://github.com/PigCI/pig-ci-rails/pull/17) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
58
|
+
- Update rspec requirement from ~\> 3.8.0 to ~\> 3.9.0 [\#16](https://github.com/PigCI/pig-ci-rails/pull/16) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
59
|
+
- Updating TravisCI to test latest ruby versions [\#15](https://github.com/PigCI/pig-ci-rails/pull/15) ([MikeRogers0](https://github.com/MikeRogers0))
|
60
|
+
|
61
|
+
## [v0.1.5](https://github.com/PigCI/pig-ci-rails/tree/v0.1.5) (2019-09-23)
|
62
|
+
|
63
|
+
[Full Changelog](https://github.com/PigCI/pig-ci-rails/compare/v0.1.4...v0.1.5)
|
64
|
+
|
65
|
+
**Merged pull requests:**
|
66
|
+
|
67
|
+
- Widen i18n gem version requirement [\#12](https://github.com/PigCI/pig-ci-rails/pull/12) ([mileszim](https://github.com/mileszim))
|
68
|
+
|
69
|
+
## [v0.1.4](https://github.com/PigCI/pig-ci-rails/tree/v0.1.4) (2019-09-10)
|
70
|
+
|
71
|
+
[Full Changelog](https://github.com/PigCI/pig-ci-rails/compare/v0.1.3...v0.1.4)
|
72
|
+
|
73
|
+
**Implemented enhancements:**
|
74
|
+
|
75
|
+
- Precompile assets before tests run [\#11](https://github.com/PigCI/pig-ci-rails/pull/11) ([MikeRogers0](https://github.com/MikeRogers0))
|
76
|
+
|
77
|
+
**Fixed bugs:**
|
78
|
+
|
79
|
+
- Fixing issue where timezone would becomes the machines on app warmup [\#5](https://github.com/PigCI/pig-ci-rails/pull/5) ([MikeRogers0](https://github.com/MikeRogers0))
|
80
|
+
|
81
|
+
**Merged pull requests:**
|
82
|
+
|
83
|
+
- Create FUNDING.yml [\#10](https://github.com/PigCI/pig-ci-rails/pull/10) ([MikeRogers0](https://github.com/MikeRogers0))
|
84
|
+
|
85
|
+
## [v0.1.3](https://github.com/PigCI/pig-ci-rails/tree/v0.1.3) (2019-08-28)
|
86
|
+
|
87
|
+
[Full Changelog](https://github.com/PigCI/pig-ci-rails/compare/v0.1.2...v0.1.3)
|
88
|
+
|
89
|
+
**Fixed bugs:**
|
90
|
+
|
91
|
+
- Gracefully handling SockerError when submitting reports while offline [\#7](https://github.com/PigCI/pig-ci-rails/pull/7) ([MikeRogers0](https://github.com/MikeRogers0))
|
92
|
+
|
93
|
+
**Merged pull requests:**
|
94
|
+
|
95
|
+
- Update rake requirement from ~\> 12.3 to ~\> 13.0 [\#14](https://github.com/PigCI/pig-ci-rails/pull/14) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
96
|
+
- Adding Dependabot Status badge to readme [\#9](https://github.com/PigCI/pig-ci-rails/pull/9) ([MikeRogers0](https://github.com/MikeRogers0))
|
97
|
+
- Fixing duplicate word typo in readme [\#8](https://github.com/PigCI/pig-ci-rails/pull/8) ([MikeRogers0](https://github.com/MikeRogers0))
|
98
|
+
- Update webmock requirement from ~\> 3.6.0 to ~\> 3.7.0 [\#6](https://github.com/PigCI/pig-ci-rails/pull/6) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
99
|
+
|
100
|
+
## [v0.1.2](https://github.com/PigCI/pig-ci-rails/tree/v0.1.2) (2019-08-03)
|
101
|
+
|
102
|
+
[Full Changelog](https://github.com/PigCI/pig-ci-rails/compare/v0.1.1...v0.1.2)
|
103
|
+
|
104
|
+
**Implemented enhancements:**
|
105
|
+
|
106
|
+
- Add options to control eager loading of rails app [\#3](https://github.com/PigCI/pig-ci-rails/pull/3) ([MikeRogers0](https://github.com/MikeRogers0))
|
107
|
+
|
108
|
+
**Merged pull requests:**
|
109
|
+
|
110
|
+
- Fixing up some codacy issues [\#4](https://github.com/PigCI/pig-ci-rails/pull/4) ([MikeRogers0](https://github.com/MikeRogers0))
|
111
|
+
|
112
|
+
## [v0.1.1](https://github.com/PigCI/pig-ci-rails/tree/v0.1.1) (2019-07-31)
|
113
|
+
|
114
|
+
[Full Changelog](https://github.com/PigCI/pig-ci-rails/compare/v0.1.0...v0.1.1)
|
115
|
+
|
116
|
+
**Merged pull requests:**
|
117
|
+
|
118
|
+
- Adding fallback for if PigCI is have API issues [\#2](https://github.com/PigCI/pig-ci-rails/pull/2) ([MikeRogers0](https://github.com/MikeRogers0))
|
119
|
+
- Adding test coverage with codeclimate [\#1](https://github.com/PigCI/pig-ci-rails/pull/1) ([MikeRogers0](https://github.com/MikeRogers0))
|
120
|
+
|
121
|
+
## [v0.1.0](https://github.com/PigCI/pig-ci-rails/tree/v0.1.0) (2019-07-30)
|
122
|
+
|
123
|
+
[Full Changelog](https://github.com/PigCI/pig-ci-rails/compare/26699470a370a1ff576f820a0742be5f332561be...v0.1.0)
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
data/Dockerfile
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
FROM ruby:2.6.6-alpine AS development
|
2
|
+
|
3
|
+
LABEL maintainer="Mike Rogers <me@mikerogers.io>"
|
4
|
+
|
5
|
+
# Install the Essentials
|
6
|
+
ENV BUILD_DEPS="curl tar wget linux-headers bash" \
|
7
|
+
DEV_DEPS="ruby-dev build-base postgresql-dev zlib-dev libxml2-dev libxslt-dev readline-dev tzdata git nodejs vim sqlite-dev"
|
8
|
+
|
9
|
+
RUN apk add --update --upgrade $BUILD_DEPS $DEV_DEPS
|
10
|
+
|
11
|
+
# Add the current apps files into docker image
|
12
|
+
RUN mkdir -p /usr/src/app
|
13
|
+
WORKDIR /usr/src/app
|
14
|
+
|
15
|
+
# Install any extra dependencies via Aptfile
|
16
|
+
COPY Aptfile /usr/src/app/Aptfile
|
17
|
+
RUN apk add --update $(cat /usr/src/app/Aptfile | xargs)
|
18
|
+
|
19
|
+
# Set up environment
|
20
|
+
ENV PATH /usr/src/app/bin:$PATH
|
21
|
+
|
22
|
+
# Add some helpers to reduce typing when inside the containers
|
23
|
+
RUN echo 'alias bx="bundle exec"' >> ~/.bashrc
|
24
|
+
|
25
|
+
# Set ruby version
|
26
|
+
COPY .ruby-version /usr/src/app
|
27
|
+
|
28
|
+
# Install latest bundler
|
29
|
+
RUN gem update --system && gem install bundler:2.0.2
|
30
|
+
RUN bundle config --global silence_root_warning 1 && echo -e 'gem: --no-document' >> /etc/gemrc
|
31
|
+
|
32
|
+
RUN mkdir -p /usr/src/bundler
|
33
|
+
RUN bundle config path /usr/src/bundler
|
34
|
+
|
35
|
+
CMD ["bundle", "exec", "rake", "spec"]
|
36
|
+
|
37
|
+
FROM development AS production
|
38
|
+
|
39
|
+
# Install Ruby Gems
|
40
|
+
COPY Gemfile /usr/src/app
|
41
|
+
COPY Gemfile.lock /usr/src/app
|
42
|
+
RUN bundle check || bundle install --jobs=$(nproc)
|
43
|
+
|
44
|
+
# Copy the rest of the app
|
45
|
+
COPY . /usr/src/app
|
data/README.md
CHANGED
@@ -76,11 +76,30 @@ PigCI.start do |config|
|
|
76
76
|
|
77
77
|
# E.g. disable terminal summary output
|
78
78
|
config.generate_terminal_summary = false
|
79
|
+
|
80
|
+
# Rails caches repeated SQL queries, you might want to omit these from your report.
|
81
|
+
config.ignore_cached_queries = true
|
79
82
|
end # if RSpec.configuration.files_to_run.count > 1
|
80
83
|
```
|
81
84
|
|
82
85
|
You can see the full configuration options [lib/pig_ci.rb](https://github.com/PigCI/pig-ci-rails/blob/master/lib/pig_ci.rb#L21).
|
83
86
|
|
87
|
+
### Skipping individual tests
|
88
|
+
|
89
|
+
If you have a scenario where you'd like PigCI to not log a specific test, you can add the RSpec metadata `pig_ci: true`. For example:
|
90
|
+
|
91
|
+
```ruby
|
92
|
+
RSpec.describe "Comments", type: :request do
|
93
|
+
# This test block will be not be tracked.
|
94
|
+
describe "GET #index", pig_ci: false do
|
95
|
+
it do
|
96
|
+
get comments_path
|
97
|
+
expect(response).to be_successful
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
```
|
102
|
+
|
84
103
|
### Framework support
|
85
104
|
|
86
105
|
Currently this gem only supports Ruby on Rails tested via RSpec.
|
@@ -132,6 +151,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
132
151
|
|
133
152
|
Features I'd like to add at some point:
|
134
153
|
|
154
|
+
* Add a conditional to only save metrics when all tests pass. So if a test suite is failing, it won't affect future stats.
|
135
155
|
* HTML output to include branch - Right now they're just timestamps which makes filtering hard.
|
136
156
|
* https://rubydoc.info/gems/yard/file/docs/GettingStarted.md - Document the gem so it's easier for people to jump on.
|
137
157
|
* Support ActionCable (when requests have no key).
|
data/docker-compose.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
# Docker Compose 2.4 is for local development
|
3
|
+
# https://www.heroku.com/podcasts/codeish/57-discussing-docker-containers-and-kubernetes-with-a-docker-captain - Source on that.
|
4
|
+
version: '2.4'
|
5
|
+
|
6
|
+
services:
|
7
|
+
web:
|
8
|
+
image: pig-ci-rails:latest
|
9
|
+
build:
|
10
|
+
context: .
|
11
|
+
dockerfile: Dockerfile
|
12
|
+
target: development
|
13
|
+
env_file:
|
14
|
+
- .env
|
15
|
+
command: >
|
16
|
+
bash -c "bundle check || bundle install &&
|
17
|
+
bundle exec rake spec"
|
18
|
+
volumes:
|
19
|
+
- .:/usr/src/app
|
20
|
+
- ~/.docker-data/ruby/2.6.6/bundler:/usr/src/bundler:delegated
|
data/lib/pig_ci.rb
CHANGED
@@ -10,12 +10,25 @@ require 'pig_ci/profiler_engine'
|
|
10
10
|
require 'pig_ci/profiler'
|
11
11
|
require 'pig_ci/metric'
|
12
12
|
require 'pig_ci/report'
|
13
|
+
require 'pig_ci/test_frameworks'
|
13
14
|
|
14
15
|
module PigCI
|
15
16
|
extend self
|
16
17
|
|
17
18
|
attr_accessor :pid
|
18
19
|
|
20
|
+
attr_writer :enabled
|
21
|
+
def enabled?
|
22
|
+
@enabled.nil? ? true : @enabled
|
23
|
+
end
|
24
|
+
|
25
|
+
# Rails caches repeated queries within the same request. You can not count
|
26
|
+
# any cached queries if you'd like.
|
27
|
+
attr_writer :ignore_cached_queries
|
28
|
+
def ignore_cached_queries?
|
29
|
+
@ignore_cached_queries.nil? ? false : @ignore_cached_queries
|
30
|
+
end
|
31
|
+
|
19
32
|
attr_writer :tmp_directory
|
20
33
|
def tmp_directory
|
21
34
|
@tmp_directory || Pathname.new(Dir.getwd).join('tmp', 'pig-ci')
|
@@ -119,6 +132,7 @@ module PigCI
|
|
119
132
|
|
120
133
|
def start(&block)
|
121
134
|
self.pid = Process.pid
|
135
|
+
PigCI::TestFrameworks::Rspec.configure! if defined?(::RSpec)
|
122
136
|
|
123
137
|
block.call(self) if block_given?
|
124
138
|
|
@@ -57,18 +57,20 @@ class PigCI::ProfilerEngine::Rails < ::PigCI::ProfilerEngine
|
|
57
57
|
profilers.each(&:reset!)
|
58
58
|
end
|
59
59
|
|
60
|
-
::ActiveSupport::Notifications.subscribe 'sql.active_record' do |_name, _started, _finished, _unique_id,
|
61
|
-
if request_key?
|
60
|
+
::ActiveSupport::Notifications.subscribe 'sql.active_record' do |_name, _started, _finished, _unique_id, payload|
|
61
|
+
if request_key? && PigCI.enabled? && ( !PigCI.ignore_cached_queries? || ( PigCI.ignore_cached_queries? && !payload[:cached] ))
|
62
62
|
profilers.select { |profiler| profiler.class == PigCI::Profiler::DatabaseRequest }.each(&:increment!)
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
66
|
::ActiveSupport::Notifications.subscribe 'process_action.action_controller' do |_name, _started, _finished, _unique_id, _payload|
|
67
|
-
|
68
|
-
profiler
|
69
|
-
|
67
|
+
if PigCI.enabled?
|
68
|
+
profilers.each do |profiler|
|
69
|
+
profiler.log_request!(request_key)
|
70
|
+
end
|
70
71
|
|
71
|
-
|
72
|
+
request_captured!
|
73
|
+
end
|
72
74
|
self.request_key = nil
|
73
75
|
end
|
74
76
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class PigCI::TestFrameworks::Rspec
|
2
|
+
def self.configure!
|
3
|
+
::RSpec.configure do |config|
|
4
|
+
config.around(:each, pig_ci: false) do |example|
|
5
|
+
@pig_ci_enabled = PigCI.enabled?
|
6
|
+
PigCI.enabled = false
|
7
|
+
example.run
|
8
|
+
PigCI.enabled = @pig_ci_enabled
|
9
|
+
end
|
10
|
+
|
11
|
+
config.around(:each, pig_ci: true) do |example|
|
12
|
+
@pig_ci_enabled = PigCI.enabled?
|
13
|
+
PigCI.enabled = true
|
14
|
+
example.run
|
15
|
+
PigCI.enabled = @pig_ci_enabled
|
16
|
+
end
|
17
|
+
|
18
|
+
end if defined?(::RSpec)
|
19
|
+
end
|
20
|
+
end
|
data/lib/pig_ci/version.rb
CHANGED
data/lib/pig_ci/views/index.erb
CHANGED
@@ -10,6 +10,8 @@
|
|
10
10
|
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
11
11
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
|
12
12
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
|
13
|
+
<link rel="shortcut icon" href="https://pigci.com/images/favicon.png"/>
|
14
|
+
<link rel="icon" type="image/ico" href="https://pigci.com/images/favicon.ico"/>
|
13
15
|
</head>
|
14
16
|
<body>
|
15
17
|
|
@@ -18,7 +20,7 @@
|
|
18
20
|
<div class="row">
|
19
21
|
<div class="col-6">
|
20
22
|
<a href="https://pigci.com/" target="_blank" rel="noopener">
|
21
|
-
<img src="https://
|
23
|
+
<img src="https://pigci.com/images/logo_pigci.svg" class="float-left mr-4" alt="PigCI Logo" />
|
22
24
|
</a>
|
23
25
|
<h1><%= I18n.t('.pig_ci.summary.title') %></h1>
|
24
26
|
</div>
|
data/pig_ci.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ['Mike Rogers']
|
9
9
|
spec.email = ['me@mikerogers.io']
|
10
10
|
|
11
|
-
spec.summary = '
|
12
|
-
spec.description = 'A gem for Ruby on Rails that will
|
11
|
+
spec.summary = 'Monitor your Ruby Applications metrics via your test suite.'
|
12
|
+
spec.description = 'A gem for Ruby on Rails that will track key metrics (memory, request time & SQL Requests) for request & feature tests.'
|
13
13
|
spec.homepage = 'https://github.com/PigCI/pig-ci-rails'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pig-ci-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Rogers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -198,7 +198,7 @@ dependencies:
|
|
198
198
|
- - "~>"
|
199
199
|
- !ruby/object:Gem::Version
|
200
200
|
version: 0.9.24
|
201
|
-
description: A gem for Ruby on Rails that will
|
201
|
+
description: A gem for Ruby on Rails that will track key metrics (memory, request
|
202
202
|
time & SQL Requests) for request & feature tests.
|
203
203
|
email:
|
204
204
|
- me@mikerogers.io
|
@@ -206,14 +206,21 @@ executables: []
|
|
206
206
|
extensions: []
|
207
207
|
extra_rdoc_files: []
|
208
208
|
files:
|
209
|
+
- ".dockerignore"
|
210
|
+
- ".env"
|
209
211
|
- ".github/FUNDING.yml"
|
212
|
+
- ".github/workflows/changelog.yml"
|
210
213
|
- ".github/workflows/gempush.yml"
|
214
|
+
- ".github/workflows/linters.yml"
|
215
|
+
- ".github/workflows/rspec.yml"
|
211
216
|
- ".gitignore"
|
212
217
|
- ".rubocop.yml"
|
213
218
|
- ".ruby-version"
|
214
219
|
- ".travis.yml"
|
220
|
+
- Aptfile
|
215
221
|
- CHANGELOG.md
|
216
222
|
- CODE_OF_CONDUCT.md
|
223
|
+
- Dockerfile
|
217
224
|
- Gemfile
|
218
225
|
- LICENSE
|
219
226
|
- README.md
|
@@ -221,6 +228,7 @@ files:
|
|
221
228
|
- bin/console
|
222
229
|
- bin/setup
|
223
230
|
- config/locales/pig_ci/en.yml
|
231
|
+
- docker-compose.yml
|
224
232
|
- lib/pig_ci.rb
|
225
233
|
- lib/pig_ci/configuration.rb
|
226
234
|
- lib/pig_ci/decorator.rb
|
@@ -243,6 +251,8 @@ files:
|
|
243
251
|
- lib/pig_ci/summary/ci.rb
|
244
252
|
- lib/pig_ci/summary/html.rb
|
245
253
|
- lib/pig_ci/summary/terminal.rb
|
254
|
+
- lib/pig_ci/test_frameworks.rb
|
255
|
+
- lib/pig_ci/test_frameworks/rspec.rb
|
246
256
|
- lib/pig_ci/version.rb
|
247
257
|
- lib/pig_ci/views/index.erb
|
248
258
|
- lib/pig_ci/views/report.erb
|
@@ -275,5 +285,5 @@ requirements: []
|
|
275
285
|
rubygems_version: 3.0.3
|
276
286
|
signing_key:
|
277
287
|
specification_version: 4
|
278
|
-
summary:
|
288
|
+
summary: Monitor your Ruby Applications metrics via your test suite.
|
279
289
|
test_files: []
|