diff --git a/.circleci/config.yml b/.circleci/config.yml index 4991560..b5b6e63 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,5 @@ version: 2 jobs: - build: docker: - image: golang @@ -26,8 +25,8 @@ jobs: rake unit_test curl -sSL https://codecov.io/bash | bash - run: - name: Command Test - command: rake command_test + name: Integration Test + command: rake integration_test - run: name: Build command: rake build @@ -36,7 +35,7 @@ jobs: command: rake install - persist_to_workspace: root: . - paths: [ bin/liche, Dockerfile.test ] + paths: [bin/liche, Dockerfile.test] docker: docker: @@ -51,4 +50,4 @@ workflows: build: jobs: - build - - docker: { requires: [ build ] } + - docker: { requires: [build] } diff --git a/.gitignore b/.gitignore index 8dd89ca..753dc4e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ bin coverage.txt +liche tmp diff --git a/examples/aruba.rb b/features/aruba.rb similarity index 100% rename from examples/aruba.rb rename to features/aruba.rb diff --git a/examples/error.feature b/features/error.feature similarity index 100% rename from examples/error.feature rename to features/error.feature diff --git a/examples/html.feature b/features/html.feature similarity index 100% rename from examples/html.feature rename to features/html.feature diff --git a/examples/markdown.feature b/features/markdown.feature similarity index 100% rename from examples/markdown.feature rename to features/markdown.feature diff --git a/examples/options.feature b/features/options.feature similarity index 100% rename from examples/options.feature rename to features/options.feature diff --git a/examples/relative_path.feature b/features/relative_path.feature similarity index 100% rename from examples/relative_path.feature rename to features/relative_path.feature diff --git a/rakefile.rb b/rakefile.rb index 2a4f2f0..cf30c53 100644 --- a/rakefile.rb +++ b/rakefile.rb @@ -1,34 +1,24 @@ -TOTAL_COVERAGE_FILE = 'coverage.txt'.freeze # This path is specified by codecov. -BIN_PATH = File.absolute_path 'bin' - task :deps do - sh 'go get github.com/alecthomas/gometalinter github.com/mattn/goveralls' + sh 'go get github.com/alecthomas/gometalinter' sh 'gometalinter --install' sh 'go get -d -t ./...' sh 'gem install rake rubocop' + sh 'bundler install' end task :build do - sh 'CGO_ENABLED=0 GOOS=linux go build -o bin/liche' -end - -task :fast_unit_test do - sh 'go test ./...' + sh 'CGO_ENABLED=0 go build -o liche' end task :unit_test do - sh "go test -covermode atomic -coverprofile #{TOTAL_COVERAGE_FILE}" + sh 'go test -covermode atomic -coverprofile coverage.txt' end -task command_test: :build do - sh 'bundler install' - sh %W[bundler exec cucumber - -r examples/aruba.rb - PATH=#{BIN_PATH}:$PATH - examples].join ' ' +task integration_test: :build do + sh 'bundler exec cucumber PATH=$PWD:$PATH' end -task test: %i[unit_test command_test] +task test: %i[unit_test integration_test] task :format do sh 'go fix ./...'