sleet 0.4.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36ddaacead84e702849b36dd91308e7028782d3775e91937054e6d2d54632554
4
- data.tar.gz: ac73e5669a06f891cc250e3c2c67d27ce38c4d9d8b72b44233cec204c4086ef4
3
+ metadata.gz: da6449a953da99cd33a455fabe362c43289fe5f8dae44383a94aa374b93096d7
4
+ data.tar.gz: 11fb84037b64b725d164f24e923e0c9fd49583170f8b2bb508051c885a91f3fb
5
5
  SHA512:
6
- metadata.gz: 24ae81f4d3265a67c3a7ee272ea5aefdb7df57fcd930e584aba4a34290c20ff16cc2fd779c5be25329e8f3cd9e2e4301cd209d478a0dd4900af9f946634b4d44
7
- data.tar.gz: eea0a055ba465999874d97ca5493b148c02039e6908d8eb75993cc7c9403afdaf5f65c2df099cf7e1ce0342c827f87b1616d39084449cff77fc385ab3a3c2a9e
6
+ metadata.gz: 11eabd22481ae44fb09ad86877d0e498cb02ebfe7214830fd47829349ebeeb44be86fe6a1474826fca1746c6fcd4b2c133a5f57412003018ab3111762dda2635
7
+ data.tar.gz: db601fb23667d2d3019fb4ad0d3e8006bc50f04093445891fa8cf53eaf71f31512c766c6fd499b410d7dd4a91134f5fde76301ea3ceea5dee44236f224994984
@@ -8,23 +8,8 @@ jobs:
8
8
  steps:
9
9
  - checkout
10
10
 
11
- - run: date +%U-%Y > 'date-cache-key.txt'
12
- - run: ruby -v > 'ruby-version.txt'
13
-
14
- ## Bundler
15
- # Restore Cache
16
- - restore_cache:
17
- keys:
18
- - gem-cache-{{ checksum "ruby-version.txt" }}-{{ checksum "sleet.gemspec" }}-
19
- - gem-cache-{{ checksum "ruby-version.txt" }}-
20
- - gem-cache-
21
11
  # Install
22
12
  - run: bundle check --path vendor/bundle || sudo apt-get install cmake && bundle install --path vendor/bundle
23
- # Store Cache
24
- - save_cache:
25
- key: gem-cache-{{ checksum "ruby-version.txt" }}-{{ checksum "sleet.gemspec" }}-{{ checksum "date-cache-key.txt" }}
26
- paths:
27
- - vendor/bundle
28
13
 
29
14
  - type: shell
30
15
  command: |
@@ -35,7 +20,7 @@ jobs:
35
20
  --out /tmp/test-results/rubocop.xml \
36
21
  --format progress \
37
22
  --force-exclusion \
38
- $(bundle exec rubocop --list-target-files | circleci tests split --split-by=filesize --show-counts)
23
+ $(circleci tests glob "**/*.rb" | circleci tests split --split-by=filesize --show-counts)
39
24
 
40
25
  # Run rspec in parallel
41
26
  - type: shell
data/.gitignore CHANGED
@@ -12,3 +12,5 @@
12
12
 
13
13
  # Ignore Rspec Example Status File
14
14
  spec/.rspec_example_statuses
15
+
16
+ .envrc
data/.sleet.yml CHANGED
@@ -1 +1,4 @@
1
1
  output_file: 'spec/.rspec_example_statuses'
2
+ username: coreyja
3
+ workflows:
4
+ test: spec/.rspec_example_statuses
@@ -1,20 +1,94 @@
1
- # Change Log
1
+ # Changelog
2
+
3
+ ## [v0.5.2](https://github.com/coreyja/sleet/tree/v0.5.2) (2020-06-14)
4
+
5
+ [Full Changelog](https://github.com/coreyja/sleet/compare/v0.5.1...v0.5.2)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - bug: Fix bug in error message when no upstream exists [\#79](https://github.com/coreyja/sleet/pull/79) ([coreyja](https://github.com/coreyja))
10
+
11
+ ## [v0.5.1](https://github.com/coreyja/sleet/tree/v0.5.1) (2020-06-14)
12
+
13
+ [Full Changelog](https://github.com/coreyja/sleet/compare/v0.5.0...v0.5.1)
14
+
15
+ ## [v0.5.0](https://github.com/coreyja/sleet/tree/v0.5.0) (2020-06-14)
16
+
17
+ [Full Changelog](https://github.com/coreyja/sleet/compare/v0.4.3...v0.5.0)
18
+
19
+ **Closed issues:**
20
+
21
+ - Add Support for Forked Repos in Github [\#41](https://github.com/coreyja/sleet/issues/41)
22
+
23
+ **Merged pull requests:**
24
+
25
+ - Support PR builds from forked repos!!! ✨ [\#77](https://github.com/coreyja/sleet/pull/77) ([smudge](https://github.com/smudge))
26
+ - Update rugged requirement from \>= 0.26, \< 0.100 to \>= 0.26, \< 1.1 [\#76](https://github.com/coreyja/sleet/pull/76) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
27
+ - Update rugged requirement from \>= 0.26, \< 0.29 to \>= 0.26, \< 0.100 [\#75](https://github.com/coreyja/sleet/pull/75) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
28
+ - Update thor requirement from ~\> 0.20.0 to \>= 0.20, \< 1.1 [\#70](https://github.com/coreyja/sleet/pull/70) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
29
+
30
+ ## [v0.4.3](https://github.com/coreyja/sleet/tree/v0.4.3) (2020-03-07)
31
+
32
+ [Full Changelog](https://github.com/coreyja/sleet/compare/v0.4.2...v0.4.3)
33
+
34
+ **Closed issues:**
35
+
36
+ - s/Artifcats/Artifacts/ [\#44](https://github.com/coreyja/sleet/issues/44)
37
+
38
+ **Merged pull requests:**
39
+
40
+ - fix: Replace "artifi🐱s" with "artifacts". [\#74](https://github.com/coreyja/sleet/pull/74) ([temochka](https://github.com/temochka))
41
+ - feat: Look at 100 recent builds instead of just 30. [\#73](https://github.com/coreyja/sleet/pull/73) ([temochka](https://github.com/temochka))
42
+ - Update webmock requirement from ~\> 3.7.0 to ~\> 3.8.0 [\#72](https://github.com/coreyja/sleet/pull/72) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
43
+ - Update faraday requirement from \>= 0.13.1, \< 0.16.0 to \>= 0.13.1, \< 1.1.0 [\#71](https://github.com/coreyja/sleet/pull/71) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
44
+ - Update gem-release requirement from = 2.1.0 to = 2.1.1 [\#69](https://github.com/coreyja/sleet/pull/69) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
45
+ - Update gem-release requirement from = 2.0.4 to = 2.1.0 [\#68](https://github.com/coreyja/sleet/pull/68) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
46
+ - Update gem-release requirement from = 2.0.3 to = 2.0.4 [\#67](https://github.com/coreyja/sleet/pull/67) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
47
+ - Update rake requirement from ~\> 12.3 to ~\> 13.0 [\#64](https://github.com/coreyja/sleet/pull/64) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
48
+ - Update webmock requirement from ~\> 3.6.0 to ~\> 3.7.0 [\#63](https://github.com/coreyja/sleet/pull/63) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
49
+ - Update gem-release requirement from = 2.0.2 to = 2.0.3 [\#62](https://github.com/coreyja/sleet/pull/62) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
50
+ - Update gem-release requirement from = 2.0.1 to = 2.0.2 [\#61](https://github.com/coreyja/sleet/pull/61) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
51
+ - Update webmock requirement from ~\> 3.5.1 to ~\> 3.6.0 [\#60](https://github.com/coreyja/sleet/pull/60) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
52
+
53
+ ## [v0.4.2](https://github.com/coreyja/sleet/tree/v0.4.2) (2019-05-27)
54
+
55
+ [Full Changelog](https://github.com/coreyja/sleet/compare/v0.4.1...v0.4.2)
56
+
57
+ **Closed issues:**
58
+
59
+ - Dependabot can't resolve your Ruby dependency files [\#51](https://github.com/coreyja/sleet/issues/51)
60
+ - Dependabot can't resolve your Ruby dependency files [\#50](https://github.com/coreyja/sleet/issues/50)
61
+ - Dependabot can't resolve your Ruby dependency files [\#48](https://github.com/coreyja/sleet/issues/48)
62
+ - Dependabot can't resolve your Ruby dependency files [\#49](https://github.com/coreyja/sleet/issues/49)
63
+
64
+ **Merged pull requests:**
65
+
66
+ - Fix CircleCI Builds [\#59](https://github.com/coreyja/sleet/pull/59) ([coreyja](https://github.com/coreyja))
67
+ - Add a Gitter chat badge to README.md [\#58](https://github.com/coreyja/sleet/pull/58) ([gitter-badger](https://github.com/gitter-badger))
68
+ - Symlink to docs README.md from top level [\#57](https://github.com/coreyja/sleet/pull/57) ([coreyja](https://github.com/coreyja))
69
+ - Docs site fixes [\#56](https://github.com/coreyja/sleet/pull/56) ([coreyja](https://github.com/coreyja))
70
+ - Setup Github Pages [\#54](https://github.com/coreyja/sleet/pull/54) ([coreyja](https://github.com/coreyja))
71
+ - Update rugged requirement from \>= 0.26, \< 0.28 to \>= 0.26, \< 0.29 [\#53](https://github.com/coreyja/sleet/pull/53) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
72
+ - Remove direct dependency on Bundler [\#52](https://github.com/coreyja/sleet/pull/52) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
73
+ - Update webmock requirement from ~\> 3.4.0 to ~\> 3.5.1 [\#47](https://github.com/coreyja/sleet/pull/47) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
2
74
 
3
75
  ## [v0.4.1](https://github.com/coreyja/sleet/tree/v0.4.1) (2018-11-24)
76
+
4
77
  [Full Changelog](https://github.com/coreyja/sleet/compare/v0.4.0...v0.4.1)
5
78
 
6
79
  **Merged pull requests:**
7
80
 
8
81
  - chore: Set up Rubocop-Coreyja gem [\#45](https://github.com/coreyja/sleet/pull/45) ([coreyja](https://github.com/coreyja))
9
82
  - Update README.md [\#40](https://github.com/coreyja/sleet/pull/40) ([coreyja](https://github.com/coreyja))
10
- - Update gem-release requirement to = 2.0.1 [\#33](https://github.com/coreyja/sleet/pull/33) ([dependabot[bot]](https://github.com/apps/dependabot))
11
- - Update webmock requirement to ~\> 3.4.0 [\#28](https://github.com/coreyja/sleet/pull/28) ([dependabot[bot]](https://github.com/apps/dependabot))
12
- - Update faraday requirement to \>= 0.13.1, \< 0.16.0 [\#27](https://github.com/coreyja/sleet/pull/27) ([dependabot[bot]](https://github.com/apps/dependabot))
13
- - Update rubocop requirement to ~\> 0.55.0 [\#26](https://github.com/coreyja/sleet/pull/26) ([dependabot[bot]](https://github.com/apps/dependabot))
14
- - Update gem-release requirement to = 2.0.0.rc.3 [\#25](https://github.com/coreyja/sleet/pull/25) ([dependabot[bot]](https://github.com/apps/dependabot))
15
- - Update rugged requirement to \>= 0.26, \< 0.28 [\#24](https://github.com/coreyja/sleet/pull/24) ([dependabot[bot]](https://github.com/apps/dependabot))
83
+ - Update gem-release requirement to = 2.0.1 [\#33](https://github.com/coreyja/sleet/pull/33) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
84
+ - Update webmock requirement to ~\> 3.4.0 [\#28](https://github.com/coreyja/sleet/pull/28) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
85
+ - Update faraday requirement to \>= 0.13.1, \< 0.16.0 [\#27](https://github.com/coreyja/sleet/pull/27) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
86
+ - Update rubocop requirement to ~\> 0.55.0 [\#26](https://github.com/coreyja/sleet/pull/26) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
87
+ - Update gem-release requirement to = 2.0.0.rc.3 [\#25](https://github.com/coreyja/sleet/pull/25) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
88
+ - Update rugged requirement to \>= 0.26, \< 0.28 [\#24](https://github.com/coreyja/sleet/pull/24) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
16
89
 
17
90
  ## [v0.4.0](https://github.com/coreyja/sleet/tree/v0.4.0) (2018-03-08)
91
+
18
92
  [Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.10...v0.4.0)
19
93
 
20
94
  **Closed issues:**
@@ -26,14 +100,16 @@
26
100
  - Get Token From Config File [\#21](https://github.com/coreyja/sleet/pull/21) ([coreyja](https://github.com/coreyja))
27
101
 
28
102
  ## [v0.3.10](https://github.com/coreyja/sleet/tree/v0.3.10) (2018-03-08)
103
+
29
104
  [Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.9...v0.3.10)
30
105
 
31
106
  **Merged pull requests:**
32
107
 
33
108
  - Base Version Option [\#20](https://github.com/coreyja/sleet/pull/20) ([coreyja](https://github.com/coreyja))
34
- - Update rubocop requirement to ~\> 0.53.0 [\#19](https://github.com/coreyja/sleet/pull/19) ([dependabot[bot]](https://github.com/apps/dependabot))
109
+ - Update rubocop requirement to ~\> 0.53.0 [\#19](https://github.com/coreyja/sleet/pull/19) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
35
110
 
36
111
  ## [v0.3.9](https://github.com/coreyja/sleet/tree/v0.3.9) (2018-03-04)
112
+
37
113
  [Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.8...v0.3.9)
38
114
 
39
115
  **Closed issues:**
@@ -43,17 +119,16 @@
43
119
  **Merged pull requests:**
44
120
 
45
121
  - Refactor [\#18](https://github.com/coreyja/sleet/pull/18) ([coreyja](https://github.com/coreyja))
46
- - Update rake requirement to ~\> 12.3 [\#17](https://github.com/coreyja/sleet/pull/17) ([dependabot[bot]](https://github.com/apps/dependabot))
47
- - Update faraday requirement to \>= 0.13.1, \< 0.15.0 [\#16](https://github.com/coreyja/sleet/pull/16) ([dependabot[bot]](https://github.com/apps/dependabot))
122
+ - Update rake requirement to ~\> 12.3 [\#17](https://github.com/coreyja/sleet/pull/17) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
123
+ - Update faraday requirement to \>= 0.13.1, \< 0.15.0 [\#16](https://github.com/coreyja/sleet/pull/16) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview))
124
+ - More Specs [\#15](https://github.com/coreyja/sleet/pull/15) ([coreyja](https://github.com/coreyja))
48
125
 
49
126
  ## [v0.3.8](https://github.com/coreyja/sleet/tree/v0.3.8) (2018-02-25)
50
- [Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.7...v0.3.8)
51
-
52
- **Merged pull requests:**
53
127
 
54
- - More Specs [\#15](https://github.com/coreyja/sleet/pull/15) ([coreyja](https://github.com/coreyja))
128
+ [Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.7...v0.3.8)
55
129
 
56
130
  ## [v0.3.7](https://github.com/coreyja/sleet/tree/v0.3.7) (2018-01-19)
131
+
57
132
  [Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.6...v0.3.7)
58
133
 
59
134
  **Merged pull requests:**
@@ -61,6 +136,7 @@
61
136
  - Fix token auth and finally add a spec for it so I don't break it again [\#14](https://github.com/coreyja/sleet/pull/14) ([coreyja](https://github.com/coreyja))
62
137
 
63
138
  ## [v0.3.6](https://github.com/coreyja/sleet/tree/v0.3.6) (2018-01-18)
139
+
64
140
  [Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.5...v0.3.6)
65
141
 
66
142
  **Merged pull requests:**
@@ -68,9 +144,11 @@
68
144
  - Fix Auth By Going Back to Query Params [\#13](https://github.com/coreyja/sleet/pull/13) ([coreyja](https://github.com/coreyja))
69
145
 
70
146
  ## [v0.3.5](https://github.com/coreyja/sleet/tree/v0.3.5) (2018-01-17)
147
+
71
148
  [Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.4...v0.3.5)
72
149
 
73
150
  ## [v0.3.4](https://github.com/coreyja/sleet/tree/v0.3.4) (2018-01-17)
151
+
74
152
  [Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.3...v0.3.4)
75
153
 
76
154
  **Merged pull requests:**
@@ -79,6 +157,7 @@
79
157
  - Fix Auth [\#11](https://github.com/coreyja/sleet/pull/11) ([coreyja](https://github.com/coreyja))
80
158
 
81
159
  ## [v0.3.3](https://github.com/coreyja/sleet/tree/v0.3.3) (2018-01-16)
160
+
82
161
  [Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.2...v0.3.3)
83
162
 
84
163
  **Merged pull requests:**
@@ -86,6 +165,7 @@
86
165
  - Add `version` cmd [\#10](https://github.com/coreyja/sleet/pull/10) ([coreyja](https://github.com/coreyja))
87
166
 
88
167
  ## [v0.3.2](https://github.com/coreyja/sleet/tree/v0.3.2) (2018-01-16)
168
+
89
169
  [Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.1...v0.3.2)
90
170
 
91
171
  **Merged pull requests:**
@@ -93,6 +173,7 @@
93
173
  - Update Readme and Add Descriptions to Help Menus [\#8](https://github.com/coreyja/sleet/pull/8) ([coreyja](https://github.com/coreyja))
94
174
 
95
175
  ## [v0.3.1](https://github.com/coreyja/sleet/tree/v0.3.1) (2018-01-15)
176
+
96
177
  [Full Changelog](https://github.com/coreyja/sleet/compare/v0.3.0...v0.3.1)
97
178
 
98
179
  **Merged pull requests:**
@@ -100,6 +181,7 @@
100
181
  - Add Dependency Versions [\#5](https://github.com/coreyja/sleet/pull/5) ([coreyja](https://github.com/coreyja))
101
182
 
102
183
  ## [v0.3.0](https://github.com/coreyja/sleet/tree/v0.3.0) (2018-01-15)
184
+
103
185
  [Full Changelog](https://github.com/coreyja/sleet/compare/v0.2.0...v0.3.0)
104
186
 
105
187
  **Closed issues:**
@@ -112,10 +194,13 @@
112
194
  - Error Messages [\#3](https://github.com/coreyja/sleet/pull/3) ([coreyja](https://github.com/coreyja))
113
195
 
114
196
  ## [v0.2.0](https://github.com/coreyja/sleet/tree/v0.2.0) (2018-01-14)
197
+
198
+ [Full Changelog](https://github.com/coreyja/sleet/compare/aa005fdae00ae843909f3a2d1753db3727a27c2c...v0.2.0)
199
+
115
200
  **Merged pull requests:**
116
201
 
117
202
  - Gemify [\#2](https://github.com/coreyja/sleet/pull/2) ([coreyja](https://github.com/coreyja))
118
203
 
119
204
 
120
205
 
121
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
206
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
@@ -0,0 +1 @@
1
+ ./docs/README.md
@@ -0,0 +1 @@
1
+ sleet.dev
@@ -0,0 +1,160 @@
1
+ # Sleet ☁️ ❄️
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/sleet.svg)](https://badge.fury.io/rb/sleet)
4
+ [![Maintainability](https://api.codeclimate.com/v1/badges/7f346b368d72b53ef630/maintainability)](https://codeclimate.com/github/coreyja/sleet/maintainability)
5
+ [![CircleCI](https://circleci.com/gh/coreyja/sleet.svg?style=svg)](https://circleci.com/gh/coreyja/sleet)
6
+ [![Join the chat at https://gitter.im/rspec-sleet/community](https://badges.gitter.im/rspec-sleet/community.svg)](https://gitter.im/rspec-sleet/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
7
+
8
+ ## Background and Problem
9
+
10
+ RSpec has a [feature](https://relishapp.com/rspec/rspec-core/v/3-7/docs/command-line/only-failures) that I find very useful which is the `--only-failures` option. This will re-run only that examples that failed the previous run.
11
+
12
+ CircleCI has support for [uploading artifacts](https://circleci.com/docs/2.0/artifacts/) with your builds, which allows us to store the persistance file that powers the RSpec only failures option.
13
+ However! CircleCI also supports and encourages parallelizing your build, which means even if you upload your rspec persistance file, you actually have a number of them each containing a subset of your test suite.
14
+ This is where `Sleet` comes in!
15
+
16
+ ## Purpose
17
+
18
+ This tool does two things:
19
+ 1. It downloads all of the `.rspec_failed_examples` files that were uploaded to CircleCI for the most recent build of the current branch
20
+ 2. It combines the multiple files into a single sorted `.rspec_failed_examples` file, and moves it to the [current directory](https://github.com/coreyja/CRSPFA/issues/1)
21
+
22
+ ## Getting Started
23
+
24
+ ### 1. Configure RSpec to Create and Use an example persistance file
25
+
26
+ We need to set the `example_status_persistence_file_path` config in RSpec. Here are the relevant [RSpec docs](https://relishapp.com/rspec/rspec-core/v/3-7/docs/command-line/only-failures#background).
27
+
28
+ The first step is to create(/or add to) your `spec/spec_helper.rb` file. We want to include the following configuration, which tells RSpec where to store the status persistance file. The actual location and file name are up to you, this is just an example. (Though using this name will require less configuration later.)
29
+
30
+ ```
31
+ RSpec.configure do |c|
32
+ c.example_status_persistence_file_path = ".rspec_example_statuses"
33
+ end
34
+ ```
35
+
36
+ if you just created the `spec_helper.rb` file then you will need to create a `.rspec` file containing the following to load your new helper file.
37
+
38
+ ```
39
+ --require spec_helper
40
+ ```
41
+
42
+ Again there are other ways to load your `spec_helper.rb` file, including requiring it from each spec. Pick one that works for you.
43
+
44
+ ### 2. Collect the example persistance files in CircleCI
45
+
46
+ To do this we need to create a step which [saves](https://circleci.com/docs/2.0/artifacts/) the `.rspec_example_statuses` as artifacts of the build. The following is an example of such a step in CircleCI. This must happen after rspec has run or else the persistance file will not exist.
47
+
48
+ ```
49
+ - store_artifacts:
50
+ path: .rspec_example_statuses
51
+
52
+ ```
53
+
54
+ ### 3. Save a CircleCI Token locally (to access private builds)
55
+
56
+ In order to see private builds/repos in CircleCI you will need to get a CircleCI token and save it locally to a Sleet Configuration file.
57
+ The recommended approach is to create a yml file in your home directory which contains your the key `circle_ci_token`
58
+
59
+ ```
60
+ circle_ci_token: PLACE_TOKEN_HERE
61
+ ```
62
+
63
+ An API token can be generated here: [https://circleci.com/account/api](https://circleci.com/account/api)
64
+
65
+ ### 4. Run this tool from your project
66
+
67
+ ```
68
+ sleet
69
+ ```
70
+
71
+ This will look up the latest completed build in CircleCI for this branch, and download all the relevant `.rspec_example_statuses` files. It then combines and sorts them and saves the result to the `.rspec_example_statuses` file locally.
72
+
73
+ ### 5. Run RSpec with `--only-failures`
74
+
75
+ ```
76
+ bundle exec rspec --only-failures
77
+ ```
78
+
79
+ This will run only the examples that failed in CircleCI!
80
+
81
+ ## Configuration
82
+
83
+ If you are using Worklfows in your CircleCI builds, or you are working with a different persistance file name, you may need to configure Sleet beyond the defaults.
84
+
85
+ Sleet currently supports two ways to input configurations:
86
+
87
+ 1. Through YML files
88
+ - `Sleet` will search 'up' from where the command was run and look for `.sleet.yml` files. It will combine all the files it finds, such that 'deeper' files take presedence. This allows you to have a user-level config at `~/.sleet.yml` and have project specific files which take presendence over the user level config (ex: `~/Projects/foo/.sleet.yml`)
89
+ 2. Through the CLI
90
+ - These always take presendece the options provided in the YML files
91
+
92
+ To view your current configuration use the `sleet config` command which will give you a table of the current configuration. You can also use the `--print-config` flag with the `fetch` command to print out the config, including any other CLI options. This can be useful for bebugging as the output also tells you where each option came from.
93
+
94
+ ### Options
95
+
96
+ These are the options that are currently supported
97
+
98
+ #### `--source_dir`
99
+
100
+ Alias: `s`
101
+
102
+ This is the directory of the source git repo. If a `source_dir` is NOT given we look up from the current directory for the nearest git repo.
103
+
104
+ #### `--input_file`
105
+
106
+ Alias: `i`
107
+
108
+ This is the name of the Rspec Circle Persistance File in CircleCI. The default is `.rspec_example_statuses`
109
+
110
+ This will match if the full path on CircleCI ends in the given name.
111
+
112
+ #### `--output_file`
113
+
114
+ Alias: `o`
115
+
116
+ This is the name for the output file, on your local system. It is relative to the `source_dir`.
117
+
118
+ Will be IGNORED if `workflows` is provided.
119
+
120
+ #### `--workflows`
121
+
122
+ Alias: `w`
123
+
124
+ If you are using workflows in CircleCI, then this is for you! You need to tell `Sleet` which build(s) to look in, and where each output should be saved.
125
+ The input is a hash, where the key is the build name and the value is the `output_file` for that build. Sleet supports saving the artifacts to multiple builds, meaning it can support a mono-repo setup.
126
+
127
+ Build-Test-Deploy Demo:
128
+
129
+ For this example you have three jobs in your CircleCI Workflow, `build`, `test` and `deploy`, but only 1 (the `test` build) generate an Rspec persistance file
130
+
131
+ This command will pick the `test` build and save its artifacts to the `.rspec_example_statuses` file
132
+
133
+ ```
134
+ sleet fetch --workflows test:.rspec_example_statuses
135
+ ```
136
+ MonoRepo Demo:
137
+
138
+ If you have a mono-repo that contains 3 sub-dirs. `foo`, `bar` and `baz`. And each one has an accompanying build. We can process all these sub-dirs at once with the following workflow command.
139
+
140
+ ```
141
+ sleet fetch --workflows foo-test:foo/.rpsec_example_statuses bar-test:bar/.rspec_example_statuses baz-specs:baz/spec/examples.txt
142
+ ```
143
+
144
+ #### `--username`
145
+
146
+ Alias: `u`
147
+
148
+ This is the GitHub username that is referenced by the CircleCI build. By default, Sleet will base this on your upstream git remote.
149
+
150
+ #### `--project`
151
+
152
+ Alias: `p`
153
+
154
+ This is the GitHub project that is referenced by the CircleCI build. By default, Sleet will base this on your upstream git remote.
155
+
156
+ #### `--branch`
157
+
158
+ Alias: `b`
159
+
160
+ This is the remote branch that is referenced by the CircleCI build. Sleet will attempt to guess this by default, but if you are pushing to a forked repo, you may need to specify a different branch name (e.g. "pull/1234").
@@ -0,0 +1 @@
1
+ theme: jekyll-theme-slate
@@ -25,6 +25,7 @@ require 'sleet/config'
25
25
  require 'sleet/error'
26
26
  require 'sleet/fetch_command'
27
27
  require 'sleet/job_fetcher'
28
+ require 'sleet/local_repo'
28
29
  require 'sleet/repo'
29
30
  require 'sleet/rspec_file_merger'
30
31
  require 'sleet/version'
@@ -6,14 +6,14 @@ module Sleet
6
6
  @circle_ci_token = circle_ci_token
7
7
  @github_user = github_user
8
8
  @github_repo = github_repo
9
- @branch = branch
9
+ @branch = CGI.escape(branch)
10
10
  end
11
11
 
12
12
  def builds
13
13
  @builds ||= JSON.parse(Sleet::CircleCi.get(url, circle_ci_token).body)
14
14
  end
15
15
 
16
- def builds_with_artificats
16
+ def builds_with_artifacts
17
17
  builds.select { |b| b['has_artifacts'] }
18
18
  end
19
19
 
@@ -22,7 +22,8 @@ module Sleet
22
22
  attr_reader :github_user, :github_repo, :branch, :circle_ci_token
23
23
 
24
24
  def url
25
- "https://circleci.com/api/v1.1/project/github/#{github_user}/#{github_repo}/tree/#{branch}?filter=completed"
25
+ "https://circleci.com/api/v1.1/project/github/#{github_user}/#{github_repo}/tree/#{branch}" \
26
+ '?filter=completed&limit=100'
26
27
  end
27
28
  end
28
29
  end
@@ -29,14 +29,14 @@ module Sleet
29
29
  end
30
30
 
31
31
  def chosen_build_json
32
- branch.builds_with_artificats.find do |b|
32
+ branch.builds_with_artifacts.find do |b|
33
33
  b.fetch('workflows', nil)&.fetch('job_name', nil) == job_name
34
34
  end
35
35
  end
36
36
 
37
37
  def must_find_a_build_with_artifacts!
38
38
  !chosen_build_json.nil? ||
39
- raise(Error, "No builds with artifcats found#{" for job name [#{job_name}]" if job_name}")
39
+ raise(Error, "No builds with artifacts found#{" for job name [#{job_name}]" if job_name}")
40
40
  end
41
41
 
42
42
  def chosen_build_must_have_input_file!
@@ -4,6 +4,10 @@ module Sleet
4
4
  class Cli < Thor
5
5
  default_task :fetch
6
6
 
7
+ def self.exit_on_failure?
8
+ true
9
+ end
10
+
7
11
  desc 'fetch', 'Fetch and Aggregate RSpec Persistance Files from CircleCI'
8
12
  long_desc <<~LONGDESC
9
13
  `sleet fetch` will find build(s) in CircleCI for the current branch, and
@@ -20,6 +24,15 @@ module Sleet
20
24
  option :output_file, type: :string, aliases: [:o], desc: <<~DESC
21
25
  This is the name for the output file, on your local system. It is relative to the source_dir. Will be IGNORED if workflows is provided.
22
26
  DESC
27
+ option :username, type: :string, aliases: [:u], desc: <<~DESC
28
+ This is the GitHub username that is referenced by the CircleCI build. By default, Sleet will base this on your upstream git remote.
29
+ DESC
30
+ option :project, type: :string, aliases: [:p], desc: <<~DESC
31
+ This is the GitHub project that is referenced by the CircleCI build. By default, Sleet will base this on your upstream git remote.
32
+ DESC
33
+ option :branch, type: :string, aliases: [:b], desc: <<~DESC
34
+ This is the remote branch that is referenced by the CircleCI build. Sleet will attempt to guess this by default, but if you are pushing to a forked repo, you may need to specify a different branch name (e.g. "pull/1234").
35
+ DESC
23
36
  option :workflows, type: :hash, aliases: [:w], desc: <<~DESC
24
37
  To use Sleet with CircleCI Workflows you need to tell Sleet which build(s) to look in, and where each output should be saved. The input is a hash, where the key is the build name and the value is the output_file for that build. Sleet supports saving the artifacts to multiple builds, meaning it can support a mono-repo setup.
25
38
  DESC
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sleet
4
- class Config
4
+ class Config # rubocop:disable Metrics/ClassLength
5
5
  OPTION_FILENAME = '.sleet.yml'
6
6
  HIDDEN_UNLESS_IN_CLI_OPTIONS = %w[show_sensitive print_config].freeze
7
7
  ConfigOption = Struct.new(:value, :source)
@@ -23,6 +23,18 @@ module Sleet
23
23
  options_hash[:output_file]
24
24
  end
25
25
 
26
+ def username
27
+ options_hash[:username]
28
+ end
29
+
30
+ def project
31
+ options_hash[:project]
32
+ end
33
+
34
+ def branch
35
+ options_hash[:branch]
36
+ end
37
+
26
38
  def workflows
27
39
  options_hash[:workflows]
28
40
  end
@@ -7,7 +7,6 @@ module Sleet
7
7
  end
8
8
 
9
9
  def do!
10
- repo.validate!
11
10
  error_messages = []
12
11
  fetchers.map do |fetcher|
13
12
  begin
@@ -41,10 +41,6 @@ module Sleet
41
41
  ).files
42
42
  end
43
43
 
44
- def branch
45
- repo.branch
46
- end
47
-
48
44
  def build
49
45
  build_selector.build
50
46
  end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sleet
4
+ class LocalRepo
5
+ REMOTE_BRANCH_REGEX = %r{^([^\/.]+)\/(.+)}.freeze
6
+ CURRENT_BRANCH_REGEX = %r{^refs\/heads\/}.freeze
7
+ GITHUB_MATCH_REGEX = %r{github.com[:\/](.+)\/(.+)\.git}.freeze
8
+
9
+ def initialize(source_dir:)
10
+ @source_dir = source_dir
11
+ end
12
+
13
+ def username
14
+ validate!
15
+
16
+ github_match[1]
17
+ end
18
+
19
+ def project
20
+ validate!
21
+
22
+ github_match[2]
23
+ end
24
+
25
+ def branch_name
26
+ validate!
27
+
28
+ current_branch.upstream.name.match(REMOTE_BRANCH_REGEX)[2]
29
+ end
30
+
31
+ private
32
+
33
+ attr_reader :source_dir
34
+
35
+ def current_branch_name
36
+ @current_branch_name ||= repo.head.name.sub(CURRENT_BRANCH_REGEX, '')
37
+ end
38
+
39
+ def current_branch
40
+ @current_branch ||= repo.branches[current_branch_name]
41
+ end
42
+
43
+ def github_match
44
+ @github_match ||= GITHUB_MATCH_REGEX.match(current_branch.remote.url)
45
+ end
46
+
47
+ def repo
48
+ @repo ||= Rugged::Repository.new(source_dir)
49
+ end
50
+
51
+ def validate!
52
+ return if @validated
53
+
54
+ must_be_on_branch!
55
+ must_have_an_upstream_branch!
56
+ upstream_remote_must_be_github!
57
+ @validated = true
58
+ end
59
+
60
+ def must_be_on_branch!
61
+ !current_branch.nil? ||
62
+ raise(Error, 'Not on a branch')
63
+ end
64
+
65
+ def must_have_an_upstream_branch!
66
+ !current_branch.remote.nil? ||
67
+ raise(Error, "No upstream branch set for the current branch of #{current_branch_name}")
68
+ end
69
+
70
+ def upstream_remote_must_be_github!
71
+ !github_match.nil? ||
72
+ raise(Error, 'Upstream remote is not GitHub')
73
+ end
74
+ end
75
+ end
@@ -2,87 +2,44 @@
2
2
 
3
3
  module Sleet
4
4
  class Repo
5
- REMOTE_BRANCH_REGEX = %r{^([^\/.]+)\/(.+)}.freeze
6
- CURRENT_BRANCH_REGEX = %r{^refs\/heads\/}.freeze
7
- GITHUB_MATCH_REGEX = %r{github.com[:\/](.+)\/(.+)\.git}.freeze
8
-
9
5
  def self.from_config(config)
6
+ local_repo = Sleet::LocalRepo.new(source_dir: config.source_dir)
7
+
10
8
  new(
11
- repo: Rugged::Repository.new(config.source_dir),
12
- circle_ci_token: config.circle_ci_token
9
+ circle_ci_token: config.circle_ci_token,
10
+ username: config.username || local_repo.username,
11
+ project: config.project || local_repo.project,
12
+ branch_name: config.branch || local_repo.branch_name
13
13
  )
14
14
  end
15
15
 
16
- def initialize(repo:, circle_ci_token:)
17
- @repo = repo
16
+ def initialize(circle_ci_token:, username:, project:, branch_name:)
18
17
  @circle_ci_token = circle_ci_token
18
+ @github_user = username
19
+ @github_repo = project
20
+ @branch_name = branch_name
19
21
  end
20
22
 
21
- def validate!
22
- must_be_on_branch!
23
- must_have_an_upstream_branch!
24
- upstream_remote_must_be_github!
25
- end
26
-
27
- def branch
28
- @branch ||= Sleet::Branch.new(
23
+ def build_for(build_num)
24
+ Sleet::Build.new(
29
25
  circle_ci_token: circle_ci_token,
30
26
  github_user: github_user,
31
27
  github_repo: github_repo,
32
- branch: remote_branch
28
+ build_num: build_num
33
29
  )
34
30
  end
35
31
 
36
- def build_for(build_num)
37
- Sleet::Build.new(
32
+ def branch
33
+ @branch ||= Sleet::Branch.new(
38
34
  circle_ci_token: circle_ci_token,
39
35
  github_user: github_user,
40
36
  github_repo: github_repo,
41
- build_num: build_num
37
+ branch: branch_name
42
38
  )
43
39
  end
44
40
 
45
41
  private
46
42
 
47
- attr_reader :repo, :circle_ci_token
48
-
49
- def remote_branch
50
- current_branch.upstream.name.match(REMOTE_BRANCH_REGEX)[2]
51
- end
52
-
53
- def github_user
54
- github_match[1]
55
- end
56
-
57
- def github_repo
58
- github_match[2]
59
- end
60
-
61
- def current_branch_name
62
- repo.head.name.sub(CURRENT_BRANCH_REGEX, '')
63
- end
64
-
65
- def current_branch
66
- repo.branches[current_branch_name]
67
- end
68
-
69
- def github_match
70
- @github_match ||= GITHUB_MATCH_REGEX.match(current_branch.remote.url)
71
- end
72
-
73
- def must_be_on_branch!
74
- !current_branch.nil? ||
75
- raise(Error, 'Not on a branch')
76
- end
77
-
78
- def must_have_an_upstream_branch!
79
- !current_branch.remote.nil? ||
80
- raise(Error, "No upstream branch set for the current branch of #{repo.current_branch_name}")
81
- end
82
-
83
- def upstream_remote_must_be_github!
84
- !github_match.nil? ||
85
- raise(Error, 'Upstream remote is not GitHub')
86
- end
43
+ attr_reader :circle_ci_token, :github_user, :github_repo, :branch_name
87
44
  end
88
45
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sleet
4
- VERSION = '0.4.1'
4
+ VERSION = '0.5.2'
5
5
  end
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.summary = 'CircleCI RSpec Status Persistance File Aggregator'
14
14
  spec.description = <<~DOC
15
15
  Sleet provides an easy way to grab the most recent Rspec persistance files from CircleCI.
16
- It also aggregates the artificats from CircleCI, since you will have 1 per build container.
16
+ It also aggregates the artifacts from CircleCI, since you will have 1 per build container.
17
17
  DOC
18
18
  spec.homepage = 'https://github.com/coreyja/sleet'
19
19
  spec.license = 'MIT'
@@ -26,17 +26,16 @@ Gem::Specification.new do |spec|
26
26
  spec.require_paths = ['lib']
27
27
 
28
28
  spec.add_dependency 'colorize', '~> 0.8.1'
29
- spec.add_dependency 'faraday', '>= 0.13.1', '< 0.16.0'
29
+ spec.add_dependency 'faraday', '>= 0.13.1', '< 1.1.0'
30
30
  spec.add_dependency 'rspec', '~> 3.0'
31
- spec.add_dependency 'rugged', '>= 0.26', '< 0.28'
31
+ spec.add_dependency 'rugged', '>= 0.26', '< 1.1'
32
32
  spec.add_dependency 'terminal-table', '~> 1.8'
33
- spec.add_dependency 'thor', '~> 0.20.0'
33
+ spec.add_dependency 'thor', '>= 0.20', '< 1.1'
34
34
 
35
- spec.add_development_dependency 'bundler', '~> 1.13'
36
- spec.add_development_dependency 'gem-release', '= 2.0.1'
35
+ spec.add_development_dependency 'gem-release', '= 2.1.1'
37
36
  spec.add_development_dependency 'github_changelog_generator', '~> 1.14'
38
37
  spec.add_development_dependency 'pry', '~> 0.10'
39
- spec.add_development_dependency 'rake', '~> 12.3'
40
- spec.add_development_dependency 'rubocop-coreyja', '0.3.0'
41
- spec.add_development_dependency 'webmock', '~> 3.4.0'
38
+ spec.add_development_dependency 'rake', '~> 13.0'
39
+ spec.add_development_dependency 'rubocop-coreyja', '0.4.0'
40
+ spec.add_development_dependency 'webmock', '~> 3.8.0'
42
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sleet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Alexander
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-24 00:00:00.000000000 Z
11
+ date: 2020-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: 0.13.1
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: 0.16.0
36
+ version: 1.1.0
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 0.13.1
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: 0.16.0
46
+ version: 1.1.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +67,7 @@ dependencies:
67
67
  version: '0.26'
68
68
  - - "<"
69
69
  - !ruby/object:Gem::Version
70
- version: '0.28'
70
+ version: '1.1'
71
71
  type: :runtime
72
72
  prerelease: false
73
73
  version_requirements: !ruby/object:Gem::Requirement
@@ -77,7 +77,7 @@ dependencies:
77
77
  version: '0.26'
78
78
  - - "<"
79
79
  - !ruby/object:Gem::Version
80
- version: '0.28'
80
+ version: '1.1'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: terminal-table
83
83
  requirement: !ruby/object:Gem::Requirement
@@ -96,44 +96,36 @@ dependencies:
96
96
  name: thor
97
97
  requirement: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - "~>"
99
+ - - ">="
100
100
  - !ruby/object:Gem::Version
101
- version: 0.20.0
101
+ version: '0.20'
102
+ - - "<"
103
+ - !ruby/object:Gem::Version
104
+ version: '1.1'
102
105
  type: :runtime
103
106
  prerelease: false
104
107
  version_requirements: !ruby/object:Gem::Requirement
105
108
  requirements:
106
- - - "~>"
107
- - !ruby/object:Gem::Version
108
- version: 0.20.0
109
- - !ruby/object:Gem::Dependency
110
- name: bundler
111
- requirement: !ruby/object:Gem::Requirement
112
- requirements:
113
- - - "~>"
109
+ - - ">="
114
110
  - !ruby/object:Gem::Version
115
- version: '1.13'
116
- type: :development
117
- prerelease: false
118
- version_requirements: !ruby/object:Gem::Requirement
119
- requirements:
120
- - - "~>"
111
+ version: '0.20'
112
+ - - "<"
121
113
  - !ruby/object:Gem::Version
122
- version: '1.13'
114
+ version: '1.1'
123
115
  - !ruby/object:Gem::Dependency
124
116
  name: gem-release
125
117
  requirement: !ruby/object:Gem::Requirement
126
118
  requirements:
127
119
  - - '='
128
120
  - !ruby/object:Gem::Version
129
- version: 2.0.1
121
+ version: 2.1.1
130
122
  type: :development
131
123
  prerelease: false
132
124
  version_requirements: !ruby/object:Gem::Requirement
133
125
  requirements:
134
126
  - - '='
135
127
  - !ruby/object:Gem::Version
136
- version: 2.0.1
128
+ version: 2.1.1
137
129
  - !ruby/object:Gem::Dependency
138
130
  name: github_changelog_generator
139
131
  requirement: !ruby/object:Gem::Requirement
@@ -168,45 +160,45 @@ dependencies:
168
160
  requirements:
169
161
  - - "~>"
170
162
  - !ruby/object:Gem::Version
171
- version: '12.3'
163
+ version: '13.0'
172
164
  type: :development
173
165
  prerelease: false
174
166
  version_requirements: !ruby/object:Gem::Requirement
175
167
  requirements:
176
168
  - - "~>"
177
169
  - !ruby/object:Gem::Version
178
- version: '12.3'
170
+ version: '13.0'
179
171
  - !ruby/object:Gem::Dependency
180
172
  name: rubocop-coreyja
181
173
  requirement: !ruby/object:Gem::Requirement
182
174
  requirements:
183
175
  - - '='
184
176
  - !ruby/object:Gem::Version
185
- version: 0.3.0
177
+ version: 0.4.0
186
178
  type: :development
187
179
  prerelease: false
188
180
  version_requirements: !ruby/object:Gem::Requirement
189
181
  requirements:
190
182
  - - '='
191
183
  - !ruby/object:Gem::Version
192
- version: 0.3.0
184
+ version: 0.4.0
193
185
  - !ruby/object:Gem::Dependency
194
186
  name: webmock
195
187
  requirement: !ruby/object:Gem::Requirement
196
188
  requirements:
197
189
  - - "~>"
198
190
  - !ruby/object:Gem::Version
199
- version: 3.4.0
191
+ version: 3.8.0
200
192
  type: :development
201
193
  prerelease: false
202
194
  version_requirements: !ruby/object:Gem::Requirement
203
195
  requirements:
204
196
  - - "~>"
205
197
  - !ruby/object:Gem::Version
206
- version: 3.4.0
198
+ version: 3.8.0
207
199
  description: |
208
200
  Sleet provides an easy way to grab the most recent Rspec persistance files from CircleCI.
209
- It also aggregates the artificats from CircleCI, since you will have 1 per build container.
201
+ It also aggregates the artifacts from CircleCI, since you will have 1 per build container.
210
202
  email:
211
203
  - coreyja@gmail.com
212
204
  executables:
@@ -230,6 +222,9 @@ files:
230
222
  - bin/console
231
223
  - bin/release
232
224
  - bin/setup
225
+ - docs/CNAME
226
+ - docs/README.md
227
+ - docs/_config.yml
233
228
  - exe/sleet
234
229
  - lib/sleet.rb
235
230
  - lib/sleet/artifact_downloader.rb
@@ -242,6 +237,7 @@ files:
242
237
  - lib/sleet/error.rb
243
238
  - lib/sleet/fetch_command.rb
244
239
  - lib/sleet/job_fetcher.rb
240
+ - lib/sleet/local_repo.rb
245
241
  - lib/sleet/repo.rb
246
242
  - lib/sleet/rspec_file_merger.rb
247
243
  - lib/sleet/version.rb
@@ -265,8 +261,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
265
261
  - !ruby/object:Gem::Version
266
262
  version: '0'
267
263
  requirements: []
268
- rubyforge_project:
269
- rubygems_version: 2.7.6
264
+ rubygems_version: 3.0.1
270
265
  signing_key:
271
266
  specification_version: 4
272
267
  summary: CircleCI RSpec Status Persistance File Aggregator
data/README.md DELETED
@@ -1,142 +0,0 @@
1
- # Sleet ☁️ ❄️
2
-
3
- [![Gem Version](https://badge.fury.io/rb/sleet.svg)](https://badge.fury.io/rb/sleet)
4
- [![Maintainability](https://api.codeclimate.com/v1/badges/7f346b368d72b53ef630/maintainability)](https://codeclimate.com/github/coreyja/sleet/maintainability)
5
- [![CircleCI](https://circleci.com/gh/coreyja/sleet.svg?style=svg)](https://circleci.com/gh/coreyja/sleet)
6
-
7
- ## Background and Problem
8
-
9
- RSpec has a [feature](https://relishapp.com/rspec/rspec-core/v/3-7/docs/command-line/only-failures) that I find very useful which is the `--only-failures` option. This will re-run only that examples that failed the previous run.
10
-
11
- CircleCI has support for [uploading artifcats](https://circleci.com/docs/2.0/artifacts/) with your builds, which allows us to store the persistance file that powers the RSpec only failures option.
12
- However! CircleCI also supports and encourages parallelizing your build, which means even if you upload your rspec persistance file, you actually have a number of them each containing a subset of your test suite.
13
- This is where `Sleet` comes in!
14
-
15
- ## Purpose
16
-
17
- This tool does two things:
18
- 1. It downloads all of the `.rspec_failed_examples` files that were uploaded to CircleCI for the most recent build of the current branch
19
- 2. It combines the multiple files into a single sorted `.rspec_failed_examples` file, and moves it to the [current directory](https://github.com/coreyja/CRSPFA/issues/1)
20
-
21
- ## Getting Started
22
-
23
- ### 1. Configure RSpec to Create and Use an example persistance file
24
-
25
- We need to set the `example_status_persistence_file_path` config in RSpec. Here are the relevant [RSpec docs](https://relishapp.com/rspec/rspec-core/v/3-7/docs/command-line/only-failures#background).
26
-
27
- The first step is to create(/or add to) your `spec/spec_helper.rb` file. We want to include the following configuration, which tells RSpec where to store the status persistance file. The actual location and file name are up to you, this is just an example. (Though using this name will require less configuration later.)
28
-
29
- ```
30
- RSpec.configure do |c|
31
- c.example_status_persistence_file_path = ".rspec_example_statuses"
32
- end
33
- ```
34
-
35
- if you just created the `spec_helper.rb` file then you will need to create a `.rspec` file containing the following to load your new helper file.
36
-
37
- ```
38
- --require spec_helper
39
- ```
40
-
41
- Again there are other ways to load your `spec_helper.rb` file, including requiring it from each spec. Pick one that works for you.
42
-
43
- ### 2. Collect the example persistance files in CircleCI
44
-
45
- To do this we need to create a step which [saves](https://circleci.com/docs/2.0/artifacts/) the `.rspec_example_statuses` as artifacts of the build. The following is an example of such a step in CircleCI. This must happen after rspec has run or else the persistance file will not exist.
46
-
47
- ```
48
- - store_artifacts:
49
- path: .rspec_example_statuses
50
-
51
- ```
52
-
53
- ### 3. Save a CircleCI Token locally (to access private builds)
54
-
55
- In order to see private builds/repos in CircleCI you will need to get a CircleCI token and save it locally to a Sleet Configuration file.
56
- The recommended approach is to create a yml file in your home directory which contains your the key `circle_ci_token`
57
-
58
- ```
59
- circle_ci_token: PLACE_TOKEN_HERE
60
- ```
61
-
62
- An API token can be generated here: [https://circleci.com/account/api](https://circleci.com/account/api)
63
-
64
- ### 4. Run this tool from your project
65
-
66
- ```
67
- sleet
68
- ```
69
-
70
- This will look up the latest completed build in CircleCI for this branch, and download all the relevant `.rspec_example_statuses` files. It then combines and sorts them and saves the result to the `.rspec_example_statuses` file locally.
71
-
72
- ### 5. Run RSpec with `--only-failures`
73
-
74
- ```
75
- bundle exec rspec --only-failures
76
- ```
77
-
78
- This will run only the examples that failed in CircleCI!
79
-
80
- ## Configuration
81
-
82
- If you are using Worklfows in your CircleCI builds, or you are working with a different persistance file name, you may need to configure Sleet beyond the defaults.
83
-
84
- Sleet currently supports two ways to input configurations:
85
-
86
- 1. Through YML files
87
- - `Sleet` will search 'up' from where the command was run and look for `.sleet.yml` files. It will combine all the files it finds, such that 'deeper' files take presedence. This allows you to have a user-level config at `~/.sleet.yml` and have project specific files which take presendence over the user level config (ex: `~/Projects/foo/.sleet.yml`)
88
- 2. Through the CLI
89
- - These always take presendece the options provided in the YML files
90
-
91
- To view your current configuration use the `sleet config` command which will give you a table of the current configuration. You can also use the `--print-config` flag with the `fetch` command to print out the config, including any other CLI options. This can be useful for bebugging as the output also tells you where each option came from.
92
-
93
- ### Options
94
-
95
- These are the options that are currently supported
96
-
97
- #### `source_dir`
98
-
99
- Alias: s
100
-
101
- This is the directory of the source git repo. If a `source_dir` is NOT given we look up from the current directory for the nearest git repo.
102
-
103
- #### `input_file`
104
-
105
- Alias: i
106
-
107
- This is the name of the Rspec Circle Persistance File in CircleCI. The default is `.rspec_example_statuses`
108
-
109
- This will match if the full path on CircleCI ends in the given name.
110
-
111
- #### `output_file`
112
-
113
- Alias: o
114
-
115
- This is the name for the output file, on your local system. It is relative to the `source_dir`.
116
-
117
- Will be IGNORED if `workflows` is provided.
118
-
119
- #### `workflows`
120
-
121
- Alias: w
122
-
123
- If you are using workflows in CircleCI, then this is for you! You need to tell `Sleet` which build(s) to look in, and where each output should be saved.
124
- The input is a hash, where the key is the build name and the value is the `output_file` for that build. Sleet supports saving the artifacts to multiple builds, meaning it can support a mono-repo setup.
125
-
126
- Build-Test-Deploy Demo:
127
-
128
- For this example you have three jobs in your CircleCI Workflow, `build`, `test` and `deploy`, but only 1 (the `test` build) generate an Rspec persistance file
129
-
130
- This command will pick the `test` build and save it's artificats to the `.rspec_example_statuses` file
131
-
132
- ```
133
- sleet fetch --workflows test:.rspec_example_statuses
134
- ```
135
-
136
- MonoRepo Demo:
137
-
138
- If you have a mono-repo that contains 3 sub-dirs. `foo`, `bar` and `baz`. And each one has an accompanying build. We can process all these sub-dirs at once with the following workflow command.
139
-
140
- ```
141
- sleet fetch --workflows foo-test:foo/.rpsec_example_statuses bar-test:bar/.rspec_example_statuses baz-specs:baz/spec/examples.txt
142
- ```