pig-ci-rails 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/changelog.yml +14 -10
- data/.github/workflows/gempush.yml +4 -15
- data/.github/workflows/rspec.yml +11 -24
- data/.github/workflows/standard.yml +27 -0
- data/CHANGELOG.md +36 -8
- data/Gemfile +1 -1
- data/README.md +30 -21
- data/Rakefile +2 -2
- data/config/locales/pig_ci/en.yml +1 -1
- data/lib/pig_ci.rb +20 -20
- data/lib/pig_ci/configuration.rb +2 -2
- data/lib/pig_ci/decorator.rb +1 -1
- data/lib/pig_ci/decorator/report_terminal_decorator.rb +3 -3
- data/lib/pig_ci/metric.rb +2 -2
- data/lib/pig_ci/metric/current.rb +1 -1
- data/lib/pig_ci/metric/historial/change_percentage.rb +1 -1
- data/lib/pig_ci/metric/historical.rb +5 -5
- data/lib/pig_ci/profiler.rb +7 -7
- data/lib/pig_ci/profiler/memory.rb +1 -1
- data/lib/pig_ci/profiler_engine.rb +2 -2
- data/lib/pig_ci/profiler_engine/rails.rb +11 -8
- data/lib/pig_ci/report.rb +7 -7
- data/lib/pig_ci/report/memory.rb +1 -1
- data/lib/pig_ci/summary.rb +3 -3
- data/lib/pig_ci/summary/ci.rb +7 -7
- data/lib/pig_ci/summary/html.rb +8 -8
- data/lib/pig_ci/summary/terminal.rb +3 -3
- data/lib/pig_ci/test_frameworks.rb +1 -1
- data/lib/pig_ci/test_frameworks/rspec.rb +15 -14
- data/lib/pig_ci/version.rb +1 -1
- data/lib/pig_ci/views/index.erb +4 -4
- data/pig_ci.gemspec +34 -32
- metadata +31 -32
- data/.dockerignore +0 -58
- data/.env +0 -3
- data/.github/FUNDING.yml +0 -3
- data/.github/workflows/linters.yml +0 -78
- data/.rubocop.yml +0 -17
- data/.ruby-version +0 -1
- data/.travis.yml +0 -27
- data/Aptfile +0 -0
- data/Dockerfile +0 -45
- data/docker-compose.yml +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bae1ce03e29550315c467e865b65536f7e3038567a86492b027e846eb43d1839
|
4
|
+
data.tar.gz: 8d3f2ef7753ca0495da2a865141fd986059b56a7d7d9df29e46669c6bb8455fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59292f4d7e66a68f029c33268b6a7b7628b392018950013d690ce1e5851905eede905cf294e9f98fc3b54ad4a7f0bf3a415eb3b5cc7c626fc91c8a76a8b98ffa
|
7
|
+
data.tar.gz: 560812e1afc2c67ef9769b9a149ff5bd321f6128a6fbee1afa31ad954457af440392e1cdd04d3aac8e282d0bbf892d41ba4a1f4cf4f909c005feb3a23ff8d20d
|
@@ -1,6 +1,10 @@
|
|
1
|
+
# From: https://github.com/hopsoft/stimulus_reflex/blob/master/.github/workflows/changelog.yml
|
1
2
|
name: Changelog
|
2
3
|
|
3
4
|
on:
|
5
|
+
workflow_dispatch:
|
6
|
+
release:
|
7
|
+
types: [created]
|
4
8
|
push:
|
5
9
|
branches:
|
6
10
|
- master
|
@@ -12,27 +16,27 @@ jobs:
|
|
12
16
|
if: "!contains(github.event.head_commit.message, '[nodoc]')"
|
13
17
|
steps:
|
14
18
|
- uses: actions/checkout@master
|
15
|
-
- name: Set up Ruby
|
16
|
-
uses:
|
19
|
+
- name: Set up Ruby 3.0
|
20
|
+
uses: ruby/setup-ruby@v1
|
17
21
|
with:
|
18
|
-
ruby-version:
|
19
|
-
- uses: actions/cache@
|
22
|
+
ruby-version: 3.0
|
23
|
+
- uses: actions/cache@v2
|
20
24
|
with:
|
21
25
|
path: vendor/bundle
|
22
|
-
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
26
|
+
key: ${{ runner.os }}-changelog-gem-${{ hashFiles('**/Gemfile.lock') }}
|
23
27
|
restore-keys: |
|
24
|
-
${{ runner.os }}-gem-
|
28
|
+
${{ runner.os }}-changelog-gem-
|
25
29
|
- name: Create local changes
|
26
30
|
run: |
|
27
|
-
gem install github_changelog_generator
|
28
|
-
github_changelog_generator -u
|
31
|
+
gem install github_changelog_generator -v "1.15.2"
|
32
|
+
github_changelog_generator -u ${{ github.repository_owner }} -p ${{ github.event.repository.name }} --token ${{ secrets.GITHUB_TOKEN }} --exclude-labels duplicate,question,invalid,wontfix,nodoc
|
29
33
|
- name: Commit files
|
30
34
|
run: |
|
31
35
|
git config --local user.email "github-actions@example.com"
|
32
36
|
git config --local user.name "GitHub Actions"
|
33
|
-
git commit -
|
37
|
+
git commit -am "[nodoc] Update Changelog" || echo "No changes to commit"
|
34
38
|
- name: Push changes
|
35
39
|
uses: ad-m/github-push-action@master
|
36
40
|
with:
|
37
41
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
38
|
-
|
42
|
+
branch: ${{ github.ref }}
|
@@ -11,19 +11,8 @@ jobs:
|
|
11
11
|
|
12
12
|
steps:
|
13
13
|
- uses: actions/checkout@v2
|
14
|
-
- name:
|
15
|
-
uses:
|
14
|
+
- name: Publish to GitHub Packages
|
15
|
+
uses: jstastny/publish-gem-to-github@master
|
16
16
|
with:
|
17
|
-
|
18
|
-
|
19
|
-
- name: Publish to GPR
|
20
|
-
run: |
|
21
|
-
mkdir -p $HOME/.gem
|
22
|
-
touch $HOME/.gem/credentials
|
23
|
-
chmod 0600 $HOME/.gem/credentials
|
24
|
-
printf -- "---\n:github: Bearer ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
25
|
-
gem build *.gemspec
|
26
|
-
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
27
|
-
env:
|
28
|
-
GEM_HOST_API_KEY: ${{secrets.GPR_AUTH_TOKEN}}
|
29
|
-
OWNER: PigCI
|
17
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
18
|
+
owner: MikeRogers0
|
data/.github/workflows/rspec.yml
CHANGED
@@ -1,38 +1,25 @@
|
|
1
1
|
---
|
2
|
-
name:
|
2
|
+
name: Testing
|
3
3
|
|
4
4
|
on:
|
5
5
|
push:
|
6
|
-
branches: [ master ]
|
7
6
|
pull_request:
|
8
|
-
branches: [ master ]
|
9
7
|
|
10
8
|
jobs:
|
11
|
-
|
9
|
+
test:
|
10
|
+
strategy:
|
11
|
+
fail-fast: false
|
12
|
+
matrix:
|
13
|
+
ruby: [2.5, 2.6, 2.7]
|
12
14
|
runs-on: ubuntu-latest
|
15
|
+
name: Test against Ruby ${{ matrix.ruby }}
|
13
16
|
|
14
17
|
steps:
|
15
|
-
- uses: actions/checkout@
|
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
|
18
|
+
- uses: actions/checkout@v2
|
19
|
+
- uses: ruby/setup-ruby@v1
|
23
20
|
with:
|
24
|
-
|
25
|
-
|
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
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
22
|
+
bundler-cache: true
|
36
23
|
- name: Run tests
|
37
24
|
env:
|
38
25
|
RAILS_ENV: test
|
@@ -0,0 +1,27 @@
|
|
1
|
+
name: Standard
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches-ignore:
|
6
|
+
- master
|
7
|
+
jobs:
|
8
|
+
standard:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v2
|
13
|
+
- name: Set up Ruby 2.7
|
14
|
+
uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: 2.7
|
17
|
+
- name: Cache gems
|
18
|
+
uses: actions/cache@v2
|
19
|
+
with:
|
20
|
+
path: vendor/bundle
|
21
|
+
key: ${{ runner.os }}-standardrb
|
22
|
+
- name: Install gems
|
23
|
+
run: |
|
24
|
+
bundle config path vendor/bundle
|
25
|
+
gem install standardrb
|
26
|
+
- name: Run Standard
|
27
|
+
run: standardrb
|
data/CHANGELOG.md
CHANGED
@@ -2,11 +2,39 @@
|
|
2
2
|
|
3
3
|
## [Unreleased](https://github.com/PigCI/pig-ci-rails/tree/HEAD)
|
4
4
|
|
5
|
-
[Full Changelog](https://github.com/PigCI/pig-ci-rails/compare/v1.0.
|
5
|
+
[Full Changelog](https://github.com/PigCI/pig-ci-rails/compare/v1.0.1...HEAD)
|
6
6
|
|
7
|
-
**
|
7
|
+
**Fixed bugs:**
|
8
|
+
|
9
|
+
- Only eager loading app in Rails \>5.0 [\#38](https://github.com/PigCI/pig-ci-rails/pull/38) ([MikeRogers0](https://github.com/MikeRogers0))
|
10
|
+
|
11
|
+
**Merged pull requests:**
|
8
12
|
|
9
|
-
-
|
13
|
+
- Adding End Of Life notice [\#68](https://github.com/PigCI/pig-ci-rails/pull/68) ([MikeRogers0](https://github.com/MikeRogers0))
|
14
|
+
- Updating .github/workflows to be simpler [\#67](https://github.com/PigCI/pig-ci-rails/pull/67) ([MikeRogers0](https://github.com/MikeRogers0))
|
15
|
+
- Using pigci.mikerogers.io over pigci.com [\#66](https://github.com/PigCI/pig-ci-rails/pull/66) ([MikeRogers0](https://github.com/MikeRogers0))
|
16
|
+
- Updating changelog generator to push to master [\#60](https://github.com/PigCI/pig-ci-rails/pull/60) ([MikeRogers0](https://github.com/MikeRogers0))
|
17
|
+
- Update webmock requirement from ~\> 3.9.3 to ~\> 3.11.0 [\#59](https://github.com/PigCI/pig-ci-rails/pull/59) ([dependabot[bot]](https://github.com/apps/dependabot))
|
18
|
+
- Upating Rubocop configuration [\#58](https://github.com/PigCI/pig-ci-rails/pull/58) ([MikeRogers0](https://github.com/MikeRogers0))
|
19
|
+
- Making GitHub Actions versions less specific [\#57](https://github.com/PigCI/pig-ci-rails/pull/57) ([MikeRogers0](https://github.com/MikeRogers0))
|
20
|
+
- Update simplecov requirement from ~\> 0.17.0 to ~\> 0.20.0 [\#56](https://github.com/PigCI/pig-ci-rails/pull/56) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
|
21
|
+
- Update rspec requirement from ~\> 3.9.0 to ~\> 3.10.0 [\#53](https://github.com/PigCI/pig-ci-rails/pull/53) ([dependabot[bot]](https://github.com/apps/dependabot))
|
22
|
+
- Update terminal-table requirement from ~\> 1.8.0 to \>= 1.8, \< 2.1 [\#52](https://github.com/PigCI/pig-ci-rails/pull/52) ([dependabot[bot]](https://github.com/apps/dependabot))
|
23
|
+
- Revamping Github Actions [\#49](https://github.com/PigCI/pig-ci-rails/pull/49) ([MikeRogers0](https://github.com/MikeRogers0))
|
24
|
+
- Update actions/cache requirement to v2.1.2 [\#48](https://github.com/PigCI/pig-ci-rails/pull/48) ([dependabot[bot]](https://github.com/apps/dependabot))
|
25
|
+
- Update webmock requirement from ~\> 3.8.0 to ~\> 3.9.3 [\#47](https://github.com/PigCI/pig-ci-rails/pull/47) ([dependabot[bot]](https://github.com/apps/dependabot))
|
26
|
+
- Adding Dependabot.yml [\#45](https://github.com/PigCI/pig-ci-rails/pull/45) ([MikeRogers0](https://github.com/MikeRogers0))
|
27
|
+
- Ditching Docker Setup [\#44](https://github.com/PigCI/pig-ci-rails/pull/44) ([MikeRogers0](https://github.com/MikeRogers0))
|
28
|
+
- Adding funding\_uri metadata to gemspec [\#43](https://github.com/PigCI/pig-ci-rails/pull/43) ([MikeRogers0](https://github.com/MikeRogers0))
|
29
|
+
- Updating badges to reference GitHub Actions [\#42](https://github.com/PigCI/pig-ci-rails/pull/42) ([MikeRogers0](https://github.com/MikeRogers0))
|
30
|
+
- Removing Aptfile from repo [\#41](https://github.com/PigCI/pig-ci-rails/pull/41) ([MikeRogers0](https://github.com/MikeRogers0))
|
31
|
+
- Limiting GitHub Actions to just Rubocop & Rspec [\#40](https://github.com/PigCI/pig-ci-rails/pull/40) ([MikeRogers0](https://github.com/MikeRogers0))
|
32
|
+
- Updating docker setup to be a little slimmer [\#39](https://github.com/PigCI/pig-ci-rails/pull/39) ([MikeRogers0](https://github.com/MikeRogers0))
|
33
|
+
- Adding github sponsorship links [\#37](https://github.com/PigCI/pig-ci-rails/pull/37) ([MikeRogers0](https://github.com/MikeRogers0))
|
34
|
+
|
35
|
+
## [v1.0.1](https://github.com/PigCI/pig-ci-rails/tree/v1.0.1) (2020-05-11)
|
36
|
+
|
37
|
+
[Full Changelog](https://github.com/PigCI/pig-ci-rails/compare/v1.0.0...v1.0.1)
|
10
38
|
|
11
39
|
**Merged pull requests:**
|
12
40
|
|
@@ -57,6 +85,7 @@
|
|
57
85
|
- 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
86
|
- 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
87
|
- Updating TravisCI to test latest ruby versions [\#15](https://github.com/PigCI/pig-ci-rails/pull/15) ([MikeRogers0](https://github.com/MikeRogers0))
|
88
|
+
- 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))
|
60
89
|
|
61
90
|
## [v0.1.5](https://github.com/PigCI/pig-ci-rails/tree/v0.1.5) (2019-09-23)
|
62
91
|
|
@@ -74,10 +103,6 @@
|
|
74
103
|
|
75
104
|
- Precompile assets before tests run [\#11](https://github.com/PigCI/pig-ci-rails/pull/11) ([MikeRogers0](https://github.com/MikeRogers0))
|
76
105
|
|
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
106
|
**Merged pull requests:**
|
82
107
|
|
83
108
|
- Create FUNDING.yml [\#10](https://github.com/PigCI/pig-ci-rails/pull/10) ([MikeRogers0](https://github.com/MikeRogers0))
|
@@ -92,7 +117,6 @@
|
|
92
117
|
|
93
118
|
**Merged pull requests:**
|
94
119
|
|
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
120
|
- Adding Dependabot Status badge to readme [\#9](https://github.com/PigCI/pig-ci-rails/pull/9) ([MikeRogers0](https://github.com/MikeRogers0))
|
97
121
|
- Fixing duplicate word typo in readme [\#8](https://github.com/PigCI/pig-ci-rails/pull/8) ([MikeRogers0](https://github.com/MikeRogers0))
|
98
122
|
- 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))
|
@@ -105,6 +129,10 @@
|
|
105
129
|
|
106
130
|
- 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
131
|
|
132
|
+
**Fixed bugs:**
|
133
|
+
|
134
|
+
- 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))
|
135
|
+
|
108
136
|
**Merged pull requests:**
|
109
137
|
|
110
138
|
- Fixing up some codacy issues [\#4](https://github.com/PigCI/pig-ci-rails/pull/4) ([MikeRogers0](https://github.com/MikeRogers0))
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,17 +1,35 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
[![Maintainability](https://api.codeclimate.com/v1/badges/d022db58c712d425dba9/maintainability)](https://codeclimate.com/github/PigCI/pig-ci-rails/maintainability)
|
5
|
-
[![Test Coverage](https://api.codeclimate.com/v1/badges/d022db58c712d425dba9/test_coverage)](https://codeclimate.com/github/PigCI/pig-ci-rails/test_coverage)
|
6
|
-
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=PigCI/pig-ci-rails)](https://dependabot.com)
|
1
|
+
<h1 align="center">
|
2
|
+
PigCI
|
3
|
+
</h1>
|
7
4
|
|
8
|
-
|
5
|
+
<p align="center">
|
6
|
+
Monitor your Ruby Applications metrics (Memory, SQL Requests & Request Time) as part of your test suite. If your app exceeds an acceptable threshold it'll fail the test suite.
|
7
|
+
</p>
|
9
8
|
|
10
|
-
|
9
|
+
<p align="center">
|
10
|
+
<a target="_blank" rel="noopener noreferrer" href="https://badge.fury.io/rb/pig-ci-rails">
|
11
|
+
<img src="https://badge.fury.io/rb/pig-ci-rails.svg" alt="Gem Version" style="max-width:100%;">
|
12
|
+
</a>
|
13
|
+
<a target="_blank" rel="noopener noreferrer" href="https://github.com/PigCI/pig-ci-rails/workflows/RSpec/badge.svg">
|
14
|
+
<img src="https://github.com/PigCI/pig-ci-rails/workflows/RSpec/badge.svg" alt="RSpec" style="max-width:100%;">
|
15
|
+
</a>
|
16
|
+
<a target="_blank" rel="noopener noreferrer" href="https://github.com/PigCI/pig-ci-rails/workflows/Linters/badge.svg">
|
17
|
+
<img src="https://github.com/PigCI/pig-ci-rails/workflows/Linters/badge.svg" alt="Linters" style="max-width:100%;">
|
18
|
+
</a>
|
19
|
+
</p>
|
20
|
+
|
21
|
+
|
22
|
+
## Deprecation notice
|
11
23
|
|
12
|
-
|
24
|
+
This gem is not longer actively maintained, I suggest using theses alternatives instead:
|
13
25
|
|
14
|
-
|
26
|
+
- [TestProf](https://github.com/test-prof/test-prof)
|
27
|
+
- [rack-mini-profiler](https://github.com/MiniProfiler/rack-mini-profiler)
|
28
|
+
- [RSpec::Benchmark](https://github.com/piotrmurach/rspec-benchmark)
|
29
|
+
|
30
|
+
## Sample Output
|
31
|
+
|
32
|
+
![Sample Output of PigCI in TravisCI](https://user-images.githubusercontent.com/325384/78711087-545b6400-790e-11ea-96b7-bb75c119914a.png)
|
15
33
|
|
16
34
|
## Installation
|
17
35
|
|
@@ -26,13 +44,13 @@ end
|
|
26
44
|
And then execute:
|
27
45
|
|
28
46
|
```bash
|
29
|
-
bundle
|
47
|
+
$ bundle
|
30
48
|
```
|
31
49
|
|
32
50
|
Or install it yourself as:
|
33
51
|
|
34
52
|
```bash
|
35
|
-
gem install pig-ci-rails
|
53
|
+
$ gem install pig-ci-rails
|
36
54
|
```
|
37
55
|
|
38
56
|
## Usage
|
@@ -147,15 +165,6 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
147
165
|
|
148
166
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
149
167
|
|
150
|
-
## TODO
|
151
|
-
|
152
|
-
Features I'd like to add at some point:
|
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.
|
155
|
-
* HTML output to include branch - Right now they're just timestamps which makes filtering hard.
|
156
|
-
* https://rubydoc.info/gems/yard/file/docs/GettingStarted.md - Document the gem so it's easier for people to jump on.
|
157
|
-
* Support ActionCable (when requests have no key).
|
158
|
-
|
159
168
|
## Contributing
|
160
169
|
|
161
170
|
Bug reports and pull requests are welcome on GitHub at [PigCI/pig-ci-rails](https://github.com/PigCI/pig-ci-rails). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
data/Rakefile
CHANGED
@@ -8,7 +8,7 @@ en:
|
|
8
8
|
view_historic_reports: 'Historic Reports'
|
9
9
|
footer_html: |
|
10
10
|
<p>Generated <time datetime="%{generated_at}">%{generated_at}</time> by PigCI.</p>
|
11
|
-
<p>Support <a href="https://pigci.
|
11
|
+
<p>Support <a href="https://pigci.mikerogers.io/" target="_blank" rel="noopener">PigCI</a> by <a href="https://www.buymeacoffee.com/MikeRogers0" target="_blank" rel="noopener">buying me a coffee</a>.</p>
|
12
12
|
|
13
13
|
report:
|
14
14
|
memory:
|
data/lib/pig_ci.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
12
|
-
require
|
13
|
-
require
|
1
|
+
require "active_support"
|
2
|
+
require "active_support/core_ext/string/inflections"
|
3
|
+
require "rake"
|
4
|
+
|
5
|
+
require "pig_ci/version"
|
6
|
+
require "pig_ci/configuration"
|
7
|
+
require "pig_ci/decorator"
|
8
|
+
require "pig_ci/summary"
|
9
|
+
require "pig_ci/profiler_engine"
|
10
|
+
require "pig_ci/profiler"
|
11
|
+
require "pig_ci/metric"
|
12
|
+
require "pig_ci/report"
|
13
|
+
require "pig_ci/test_frameworks"
|
14
14
|
|
15
15
|
module PigCI
|
16
16
|
extend self
|
@@ -31,12 +31,12 @@ module PigCI
|
|
31
31
|
|
32
32
|
attr_writer :tmp_directory
|
33
33
|
def tmp_directory
|
34
|
-
@tmp_directory || Pathname.new(Dir.getwd).join(
|
34
|
+
@tmp_directory || Pathname.new(Dir.getwd).join("tmp", "pig-ci")
|
35
35
|
end
|
36
36
|
|
37
37
|
attr_writer :output_directory
|
38
38
|
def output_directory
|
39
|
-
@output_directory || Pathname.new(Dir.getwd).join(
|
39
|
+
@output_directory || Pathname.new(Dir.getwd).join("pig-ci")
|
40
40
|
end
|
41
41
|
|
42
42
|
attr_accessor :generate_terminal_summary
|
@@ -102,17 +102,17 @@ module PigCI
|
|
102
102
|
|
103
103
|
attr_writer :commit_sha1
|
104
104
|
def commit_sha1
|
105
|
-
@commit_sha1 || ENV[
|
105
|
+
@commit_sha1 || ENV["CI_COMMIT_ID"] || ENV["CIRCLE_SHA1"] || ENV["TRAVIS_COMMIT"] || `git rev-parse HEAD`.strip
|
106
106
|
end
|
107
107
|
|
108
108
|
attr_writer :head_branch
|
109
109
|
def head_branch
|
110
|
-
@head_branch || ENV[
|
110
|
+
@head_branch || ENV["CI_BRANCH"] || ENV["CIRCLE_BRANCH"] || ENV["TRAVIS_BRANCH"] || `git rev-parse --abbrev-ref HEAD`.strip
|
111
111
|
end
|
112
112
|
|
113
113
|
# Throw deprecation notice for setting API
|
114
114
|
def api_key=(value)
|
115
|
-
puts
|
115
|
+
puts "DEPRECATED: PigCI.com API has been retired, you no longer need to set config.api_key in your spec/rails_helper.rb file."
|
116
116
|
end
|
117
117
|
|
118
118
|
attr_writer :locale
|
@@ -134,7 +134,7 @@ module PigCI
|
|
134
134
|
self.pid = Process.pid
|
135
135
|
PigCI::TestFrameworks::Rspec.configure! if defined?(::RSpec)
|
136
136
|
|
137
|
-
block
|
137
|
+
block&.call(self)
|
138
138
|
|
139
139
|
# Add our translations
|
140
140
|
load_i18ns!
|
@@ -149,7 +149,7 @@ module PigCI
|
|
149
149
|
|
150
150
|
def load_i18ns!
|
151
151
|
I18n.available_locales << PigCI.locale
|
152
|
-
I18n.load_path += Dir["#{File.expand_path(
|
152
|
+
I18n.load_path += Dir["#{File.expand_path("../config/locales/pig_ci", __dir__)}/*.{rb,yml}"]
|
153
153
|
end
|
154
154
|
|
155
155
|
def run_exit_tasks!
|
data/lib/pig_ci/configuration.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class PigCI::Configuration
|
2
|
-
Thresholds = Struct.new(:memory, :request_time, :database_request)
|
2
|
+
Thresholds = Struct.new(:memory, :request_time, :database_request) {
|
3
3
|
def initialize(memory: 350, request_time: 250, database_request: 35)
|
4
4
|
super(memory, request_time, database_request)
|
5
5
|
end
|
6
|
-
|
6
|
+
}
|
7
7
|
end
|
data/lib/pig_ci/decorator.rb
CHANGED