Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Quickly run critical tests on your app, recently changed tests, or tests related to recent changed files
Add this line to your application's Gemfile:
gem 'smokescreen'
And then execute:
$ bundle
Or install it yourself as:
$ gem install smokescreen
Setting up smokescreen is fairly easy, include the gem in your Gemfile
, and then require it in your primary Rakefile
or in any of your lib/tasks/other_rakefiles
.
#in Gemfile
group :development, :test do
gem 'smokescreen'
end
#in a Rakefile
require 'smokescreen'
#below require in rake file
Smokescreen.configure(:critical_tests => ["test/functional/purchases_controller_test.rb", "test/functional/important_controller_test.rb"])
After you require smokescreen make sure to configure the critical tests. Just pass in an array of tests that you want to be be considered part of the critical set of tests.
You can view all the tasks together running bundle exec rake -T smoke
, as you can tell there are four main groupings of tests current, deploy, previous, and recent.
rake test:smokescreen:critical:functionals # Run tests for critical:functionals
rake test:smokescreen:current:all # run most important tests as well as tests for current...
rake test:smokescreen:current:changed # run tests related to currently changed files (git diff)
rake test:smokescreen:current:changed_tests # run currently changed test files (git diff)
rake test:smokescreen:current:functionals # Run tests for functionals
rake test:smokescreen:current:functionals:changed_tests # Run tests for functionals:changed_tests
rake test:smokescreen:current:units # Run tests for units
rake test:smokescreen:current:units:changed_tests # Run tests for units:changed_tests
rake test:smokescreen:deploy:all # run most important tests as well as tests for files c...
rake test:smokescreen:deploy:changed # run tests related to files changed since last deploy
rake test:smokescreen:deploy:functionals # Run tests for functionals
rake test:smokescreen:deploy:units # Run tests for units
rake test:smokescreen:previous:all # run most important tests as well as tests for previou...
rake test:smokescreen:previous:changed # run tests related to previously changed files (last c...
rake test:smokescreen:previous:changed_tests # run previously changed test files (last commit, git s...
rake test:smokescreen:previous:functionals # Run tests for functionals
rake test:smokescreen:previous:functionals:changed_tests # Run tests for functionals:changed_tests
rake test:smokescreen:previous:units # Run tests for units
rake test:smokescreen:previous:units:changed_tests # Run tests for units:changed_tests
rake test:smokescreen:recent:all # run most important tests as well as recently effected...
rake test:smokescreen:recent:changed # run tests for currently changed files (git diff)
rake test:smokescreen:recent:changed_tests # run recently changed test files (current and previous...
rake test:smokescreen:recent:functionals # Run tests for functionals
rake test:smokescreen:recent:functionals:changed_tests # Run tests for functionals:changed_tests
rake test:smokescreen:recent:units # Run tests for units
rake test:smokescreen:recent:units:changed_tests # Run tests for units:changed_tests
The most common task I run is rake test:smokescreen:recent:all
, as it is the most comprehensive. That task runs the critical tests, test files related to currently change files (as found by git diff), and test files related to recently changed files (as found by git show). It is easy to target more specifically if you choose.
I also find running rake test:smokescreen:previous:changed_tests
or rake test:smokescreen:previous:all
handy when doing code review on another developers cherry-picked commit. Making sure the tests don't have one of the "it works on my machine" bugs.
Smokescreen has only been used on a small set of projects, and doesn't currently support anything other than test:unit
. I know now that it is extracted out that I plan to add it to some other projects and hopefully it will be easy to make some improvements to the tool. I already know there could be some great improvements to the process of matching up likely related test files to recent changes. Adding support to run any recently failing tests from CI would also be another great feature.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that smokescreen demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.