Skip to content

Commit

Permalink
Add awspec to testing lambda functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tomohiro committed Jul 26, 2016
1 parent a4b7b78 commit a9d8a2c
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,11 @@ target/
# Direnv
.envrc
.direnv

# Ruby/Bundler
.bundle
vendor

# Terraform
*.tfstate
*.tfstate.backup
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--format documentation
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.3.1
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

gem 'rake'
gem 'awspec'
66 changes: 66 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.7)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
aws-sdk (2.2.37)
aws-sdk-resources (= 2.2.37)
aws-sdk-core (2.2.37)
jmespath (~> 1.0)
aws-sdk-resources (2.2.37)
aws-sdk-core (= 2.2.37)
aws_config (0.0.4)
awsecrets (1.3.0)
aws-sdk (>= 2.2.7, < 2.4)
aws_config (= 0.0.4)
awspec (0.47.0)
activesupport (~> 4.0)
aws-sdk (~> 2.2.37)
awsecrets (~> 1.3.0)
rspec (~> 3.0)
rspec-its
term-ansicolor
thor
diff-lcs (1.2.5)
i18n (0.7.0)
jmespath (1.3.1)
json (1.8.3)
minitest (5.9.0)
rake (11.2.2)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.1)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-its (1.2.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
term-ansicolor (1.3.2)
tins (~> 1.0)
thor (0.19.1)
thread_safe (0.3.5)
tins (1.11.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)

PLATFORMS
ruby

DEPENDENCIES
awspec
rake

BUNDLED WITH
1.12.5
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ Requirements
--------------------------------------------------------------------------------

- Python 2.7 (Recommend [yyuu/pyenv: Simple Python version management](https://github.com/yyuu/pyenv))
- pip
- virtualenv
- pip
- virtualenv
- Ruby 2.3.1 (Recoomend [rbenv/rbenv: Groom your app’s Ruby environment with rbenv](https://github.com/rbenv/rbenv))
- RubyGems
- Bundler
- Terraform


Getting Started
Expand All @@ -19,6 +23,7 @@ Install dependencies:

```sh
$ pip install -r requirements.txt
$ bundle install --path vendor/bundle
```

Create IAM role to execute lambda functions:
Expand All @@ -32,6 +37,8 @@ $ apex infra apply # Apply changes
Development AWS Lambda functions
--------------------------------------------------------------------------------

### Create a function

Move to the `example` function directory:

```
Expand All @@ -58,6 +65,15 @@ $ apex deploy example --chdir ../../ --log-level debug
```


### Project testing

Run all tests:

```sh
$ bundle exec rake spec
```


LICENSE
--------------------------------------------------------------------------------

Expand Down
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new('spec')
task :default => :spec
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require 'awspec'

0 comments on commit a9d8a2c

Please sign in to comment.