Skip to content

Commit 678735f

Browse files
committed
Add rspec-terraform, add unit tests, add rubocop.
1 parent 81a4d1d commit 678735f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+2061
-1060
lines changed

.circleci/config.yml

+31-6
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,26 @@ commands:
7070
- run: ./scripts/ci/common/configure-git.sh
7171

7272
jobs:
73-
test:
73+
build:
7474
<<: *defaults
7575
steps:
7676
- checkout
7777
- configure_tools
7878
- queue/until_front_of_line:
7979
consider-branch: false
80-
- run: ./scripts/ci/steps/test.sh
80+
- run: ./scripts/ci/steps/build.sh
81+
- notify
82+
83+
test:
84+
<<: *defaults
85+
steps:
86+
- checkout
87+
- configure_tools
88+
- run:
89+
no_output_timeout: 30m
90+
command: ./scripts/ci/steps/test.sh
91+
- store_artifacts:
92+
path: build/logs
8193
- notify
8294

8395
prerelease:
@@ -108,26 +120,39 @@ workflows:
108120
version: 2
109121
pipeline:
110122
jobs:
111-
- test:
123+
- build:
124+
<<: *only_main_and_dependabot
112125
<<: *slack_context
126+
- test:
113127
<<: *only_main_and_dependabot
114-
- merge_pull_request:
115128
<<: *slack_context
129+
requires:
130+
- build
131+
- merge_pull_request:
116132
<<: *only_dependabot
133+
<<: *slack_context
117134
requires:
118135
- test
119136
- prerelease:
120-
<<: *slack_context
121137
<<: *only_main
138+
<<: *slack_context
122139
requires:
123140
- test
141+
- slack/on-hold:
142+
<<: *only_main
143+
<<: *slack_context
144+
requires:
145+
- prerelease
146+
channel: release
147+
template: SLACK_ON_HOLD_NOTIFICATION
124148
- hold:
125149
<<: *only_main
126150
type: approval
127151
requires:
128152
- prerelease
153+
- slack/on-hold
129154
- release:
130-
<<: *slack_context
131155
<<: *only_main
156+
<<: *slack_context
132157
requires:
133158
- hold

.envrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
PROJECT_DIR="$(pwd)"
44

5-
PATH_add ${PROJECT_DIR}
6-
PATH_add ${PROJECT_DIR}/vendor/terraform/bin
5+
PATH_add "${PROJECT_DIR}"
6+
PATH_add "${PROJECT_DIR}"/vendor/terraform/bin

.github/dependabot.yml

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "daily"
8-
ignore:
9-
- dependency-name: "hashicorp/aws"
108

119
- package-ecosystem: "bundler"
1210
directory: "/"

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ vendor/
1313
build/
1414
dist/
1515
.bundle
16+
.rakeTasks
1617

1718
# OS
1819
.DS_Store
@@ -22,12 +23,13 @@ run/pids/
2223
run/logs/
2324
*.log
2425
.tmp
25-
.rakeTasks
2626

2727
# RSpec
2828
.rspec_status
2929

3030
# Terraform
31+
state/
3132
.terraform
33+
*.tfplan
3234
*.tfstate
3335
*.tfstate.backup

.rubocop.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
require:
2+
- rubocop-rake
3+
- rubocop-rspec
4+
5+
AllCops:
6+
NewCops: enable
7+
8+
Layout/LineLength:
9+
Max: 80
10+
11+
Metrics/BlockLength:
12+
AllowedMethods:
13+
- describe
14+
- context
15+
- shared_examples
16+
- it
17+
Exclude:
18+
- Rakefile
19+
20+
Style/Documentation:
21+
Enabled: false
22+
23+
RSpec/ExampleLength:
24+
Max: 40
25+
26+
RSpec/DescribeClass:
27+
Enabled: false
28+
29+
RSpec/InstanceVariable:
30+
Enabled: false
31+
32+
RSpec/BeforeAfterAll:
33+
Enabled: false
34+
35+
RSpec/MultipleMemoizedHelpers:
36+
Max: 10

CODE_OF_CONDUCT.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
In the interest of fostering an open and welcoming environment, we as
66
contributors and maintainers pledge to making participation in our project and
77
our community a harassment-free experience for everyone, regardless of age, body
8-
size, disability, ethnicity, gender identity and expression, level of experience,
9-
nationality, personal appearance, race, religion, or sexual identity and
10-
orientation.
8+
size, disability, ethnicity, gender identity and expression, level of
9+
experience, nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
1111

1212
## Our Standards
1313

@@ -23,7 +23,7 @@ include:
2323
Examples of unacceptable behavior by participants include:
2424

2525
* The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
26+
advances
2727
* Trolling, insulting/derogatory comments, and personal or political attacks
2828
* Public or private harassment
2929
* Publishing others' private information, such as a physical or electronic
@@ -58,17 +58,18 @@ Instances of abusive, harassing, or otherwise unacceptable behavior may be
5858
reported by contacting the project team at maintainers@infrablocks.io. All
5959
complaints will be reviewed and investigated and will result in a response that
6060
is deemed necessary and appropriate to the circumstances. The project team is
61-
obligated to maintain confidentiality with regard to the reporter of an incident.
62-
Further details of specific enforcement policies may be posted separately.
61+
obligated to maintain confidentiality with regard to the reporter of an
62+
incident. Further details of specific enforcement policies may be posted
63+
separately.
6364

6465
Project maintainers who do not follow or enforce the Code of Conduct in good
6566
faith may face temporary or permanent repercussions as determined by other
6667
members of the project's leadership.
6768

6869
## Attribution
6970

70-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71-
available at [http://contributor-covenant.org/version/1/4][version]
71+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
72+
version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
7273

7374
[homepage]: http://contributor-covenant.org
7475
[version]: http://contributor-covenant.org/version/1/4/

Gemfile

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1+
# frozen_string_literal: true
2+
13
source 'https://rubygems.org'
24

35
gem 'awspec'
46
gem 'confidante'
57
gem 'git'
6-
gem 'net-ssh'
78
gem 'netaddr'
8-
gem 'nokogiri'
9+
gem 'net-ssh'
910
gem 'rake'
1011
gem 'rake_circle_ci'
1112
gem 'rake_github'
1213
gem 'rake_gpg'
1314
gem 'rake_ssh'
1415
gem 'rake_terraform'
1516
gem 'rspec'
17+
gem 'rspec-terraform'
18+
gem 'rubocop'
19+
gem 'rubocop-rake'
20+
gem 'rubocop-rspec'
21+
gem 'rubyzip'
1622
gem 'semantic'

0 commit comments

Comments
 (0)