Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Codecov for test coverage; version bump 2.10.0 #28

Merged
merged 3 commits into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# vim: ft=bash
export DEBUG=true

[[ -f .envrc.local ]] && source .envrc.local

PATH_add exe
PATH_add bin
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
**/.DS_Store
.ruby-version
temp/
.envrc.local
41 changes: 14 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,21 @@
language: ruby
env:
global:
secure: TQeUpdDH/j5AefVh2NRvU8t/ftxXQqaIO5m0ir7vzJgEBuP8twTqx/CFeZWogd/u0McMgL48NHgQZGXz1n04ZZasovcrk4wd7kMwSyNTtyAa/0D5u6k1JyiynNV26MWvxXGBw4OCCfVCa4WXIM0s7YI2S/q9ZYKSWWYtw/Lo+MDHjJEIaM4EdL+b9SxF94y8DcDXy2qt7H58nUJV/RVz9uG++kuDbpoobwO8mEGGuUIcxubgFoKqOCjXkX1Qe2vY2LgJGb7OZsVDj7QhARwm1NwspxTZDgfQzeSHM5uCW5JJ40Ur4bAb4bFXDPV2yF64cagYWcQow20To1qO17UR+xIFMMV+pxnhTiiRtGzyDCoYLCc5ldXyrnVskQYtXLwrY92Na4avdWCalL8fBO7IfBVHHADowED2AW8thExf4ljVR1wzjs0vIeVmVz9ApJr25sgZjKawaosv7BHt9MDKruK7tQBY8HIAjEsP50cb42VOucY+vabWtTG6QzX+//tjsDlM0rOhSiMlqxpbrwpWxpnhc+kn3TeMPr1oU0j9gDCRMghcaCVD18JKwZMx45LEX7LZY2lQcnLmJJOwnwamuReLc/w6cMO1ORjBgRsDkyz0Jila90cTUSJq21I41srDauprolfrqT1igZ3rB/C++vA/SiG+hz7WzvMWXBv/fzs=
services:
- memcached
rvm:
- 2.3.8
- 2.4.6
- 2.5.5
- 2.6.3
- 2.4.10
- 2.5.8
- 2.6.6
- 2.7.1
notifications:
email:
recipients:
- kigster@gmail.com
on_success: change
on_failure: always
slack:
rooms:
secure: GcACCHmcmo99lYE5dgt2TmY4YIPMWr75q0Bkm4Lddegq/1eMXgcZDz00j8iHWtnveyJSjEUpZFQ9uyx+P7dvxT7D5gl43arKZEylS4vMRg9QRgZu7/ROrXbJtrUyKulFRUTdFrmOiK9nDKpAzlvLvMKC4kaQnn88Xtu9pYMU8y4n5fCtl29gZM9ZjVbrBBvV/SumnTDLla2oQ7oFgUZdZhQZ1qsevYknxNq4eIcvPDjbon+bovfsIISEVRSNo2C3yjO+mqWKed3jfuCA4taAZ8/aVVFEKURMH10HFms1CiC3lE/gF4YfBXsqKpjnB+bKjBcWox2FQrp96FulMEIfkKQrnuncO96o7MGHX9oNqKSMoycf3+SZFwNa+5Mfq7SBepbHYCoU7/ow31UTyStrc5idG19XzYgI85yjQHdzQN299Xf0O8cGf9q9qAu7rS7JlM3ekR+3rZYO+OxNYTF8rcW1fYIj6GKcbsV8BvuhAVQRFOsk/ibcIb2N7rGVd/ZbU4HAk3RE1ywt+XowinpIHktu2PQUPDNpgRQwM6xqZHO/7s9r7oW0ULmZCMLZ9CMKNjKzrQ9wfh90+v+FiEiUKsaVj4cCwF3PvhVYvxU2AKbCeHtSEb7K6to86+DYNoIKnGH1ryKoyCtyOTZpNMLGFt34Msv7WfEylhG+DpVMvkM=
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
- bundle exec exe/sym -B ~/.bash_profile -vTD
- source ~/.sym.symit.bash
- ls -alF ~/.sym*
- ls -alF .
- mkdir -p temp
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
- jruby-9.1.17.0
- jruby-9.2.13.0
script:
- USER=travis bundle exec rspec --format documentation --order random && bundle exec rubocop
- bundle exec sym -B ~/.bash_profile -vTD
- export PATH="${PWD}/exe:${PATH}"
- export RUBY_MAJOR_VERSION="$(ruby -e 'puts RUBY_VERSION.split(".")[0..1].join')"
- export USER=travis
- bundle exec rspec --format documentation --order random
- if [[ "${RUBY_MAJOR_VERSION}" == "27" ]]; then bundle exec rubocop; fi
env:
global:
secure: TEh5UdrREBCXNNxMvk+kl7PcokyIgm0JXoIQI90ZMHx75yLcSdK15zt4rTvH4FzNUmnEGQnGaEJmJMqkjy9oT1BwKedqvG6eb0BFgay8ajz+eesFKH0Vu7MrHZuKrO3mfO+llr+av4K7iQPQrHJ6+7TZKu4cysFuP+szgE1blyrSgv2NaMmb2UL0HPLn0H2vxqVGn+xfc8VWGNn0IzDBLVAeUMOKyn51PMK1zupjcS+wz3uMzTWXyuB+RvIGOcYnXNZAtIQbYnVHqohrG6iOtNtDSJIVETeybghob7dRk3NTlFQ7qbYspJCflMaGQmwVc18CCO0Sa9qCVKS+z+WAeprfGrG2lIXnTxa/76OwKbEstjOdLmovDKst5dlZnH9Osg9g0US750wndKNrRFIB1A66QTxxbHWYX8JpOTYg2asSnPLptaxF3H4l85xspoiZ6LeI4z7mH9fLr5UJnU5INDDuZ+JW7pUeSri5bTLIzMkGGPj7AHEubUiKY0ldeNfskAwkNob/+nPWTtI30ex909EHu6eSQV7JR8Ng394MOmot9xKHszOJXRltv4cRQ5k0IWW+gLpc110vtqHfe/xBuL3nXWBQnaZHzVGM2E6ctKnDdN/7zamVJEFDHevj4hO6h0WWhUINp+k3QWJvj2bNrsDttpGgw5NM85OLrthGew8=
375 changes: 201 additions & 174 deletions CHANGELOG.md

Large diffs are not rendered by default.

650 changes: 650 additions & 0 deletions README.adoc

Large diffs are not rendered by default.

623 changes: 0 additions & 623 deletions README.md

This file was deleted.

29 changes: 29 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
codecov:
require_ci_to_pass: no

notify:
wait_for_ci: yes

parsers:
v1:
include_full_missed_files: true # To use with Ruby so we see files that have NO tests written

coverage:
range: 50..75
round: down
precision: 1
status:
project:
default: off
sym:
target: 70%
threshold: 10%
informational: true
if_not_found: success
if_ci_failed: error
paths:
- lib/
flags:
sym:
paths:
- lib/
1 change: 1 addition & 0 deletions lib/sym/app/keychain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def initialize(key_name, opts = {})

def add(password)
delete rescue nil
sleep 0.1
execute command(:add, " -T /usr/bin/security -w '#{password}' ")
end

Expand Down
4 changes: 2 additions & 2 deletions lib/sym/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Sym
VERSION = '2.9.0'.freeze
VERSION = '2.10.0'.freeze
DESCRIPTION = <<~eof
Sym is a ruby library (gem) that offers both the command line interface (CLI) and a set of rich Ruby APIs, which make it rather trivial to add encryption and decryption of sensitive data to your development or deployment workflow.

Expand All @@ -17,7 +17,7 @@ module Sym

2. By utilizing OS-X Keychain on a Mac, Sym offers truly secure way of storing the key on a local machine, much more secure then storing it on a file system,

3. By using a local password cache (activated with -c) via an in-memory provider such as memcached or drb, sym invocations take advantage of password cache, and only ask for a password once per a configurable time period,
3. By using a local password cache (activated with -c) via an in-memory provider such as memcached, sym invocations take advantage of password cache, and only ask for a password once per a configurable time period,

4. By using SYM_ARGS environment variable, where common flags can be saved. This is activated with sym -A,

Expand Down
10 changes: 7 additions & 3 deletions spec/integration/sym_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,16 @@
end
end

if Sym::App.osx?
if Sym::App.osx? && ENV['SKIP_KEYCHAIN'].nil?
context 'import a key into keychain' do
let(:args) { "-k #{KEY_PLAIN} -x MOO" }
let(:keychain_name) { 'mykey' }
before { (Sym::App::KeyChain.new(keychain_name).delete rescue nil) }

let(:args) { "-k #{KEY_PLAIN} -x #{keychain_name} " }

it 'should add to keychain' do
expect(Sym::App::KeyChain.get('MOO')).to eq(KEY_PLAIN)
expect(output).to eq(KEY_PLAIN)
expect(Sym::App::KeyChain.get(keychain_name)).to eq(KEY_PLAIN)
end
end
end
Expand Down
13 changes: 12 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
require_relative '../lib/ruby_warnings'
require 'simplecov'
SimpleCov.start

SimpleCov.start do
add_filter %r{^/(spec)/}
end

if ENV['CODECOV_TOKEN'] && !(ARGV.last && File.exist?(ARGV.last))
require 'codecov'
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::Codecov
])
end

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)

Expand Down
4 changes: 2 additions & 2 deletions spec/sym/app/keychain_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Sym
module App
RSpec.describe 'Sym::App::KeyChain' do
let(:opts) { { verbose: false } }
let(:key_name) { 'silky-smooth-chocolate' }
let(:key_name) { 'your-mama-is-so' }
let(:keychain) { Sym::App::KeyChain.new(key_name, opts) }
let(:commands) { %w(add find delete) }
let(:password) { 'Sup4r!Secur3' }
Expand Down Expand Up @@ -33,7 +33,7 @@ module App
end
end

if Sym::App.osx?
if Sym::App.osx? && ENV['SKIP_KEYCHAIN'].nil?
context 'integration tests' do
before do
keychain.stderr_off
Expand Down
1 change: 1 addition & 0 deletions sym.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rspec-its'
spec.add_development_dependency 'rubocop', '0.81.0'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'codecov'
spec.add_development_dependency 'yard'
end