Skip to content

Commit

Permalink
Merge 443ddff into 2138920
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Dec 10, 2020
2 parents 2138920 + 443ddff commit 5734821
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 23 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

# See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions

name: CI

on: [push, pull_request]

jobs:
Tests:
runs-on: ubuntu-latest
container: registry.opensuse.org/yast/head/containers/yast-ruby:latest

steps:

- name: Git Checkout
uses: actions/checkout@v2

# just for easier debugging...
- name: Inspect Installed Packages
run: rpm -qa | sort

- name: Unit Tests
run: rake test:unit
# enable code coverage reporting
env:
COVERAGE: 1

# send the coverage report to coveralls.io
- name: Coveralls Report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

Rubocop:
runs-on: ubuntu-latest
container: registry.opensuse.org/yast/head/containers/yast-ruby:latest

steps:

- name: Git Checkout
uses: actions/checkout@v2

- name: Rubocop
run: rake check:rubocop

Package:
runs-on: ubuntu-latest
container: registry.opensuse.org/yast/head/containers/yast-ruby:latest

steps:

- name: Git Checkout
uses: actions/checkout@v2

- name: Package Build
run: yast-ci-ruby -o package

Yardoc:
runs-on: ubuntu-latest
container: registry.opensuse.org/yast/head/containers/yast-ruby:latest

steps:

- name: Git Checkout
uses: actions/checkout@v2

- name: Yardoc
run: rake check:doc

# downloading the Docker image takes some time so bundling several fast
# checks into one job avoids that overhead
Checks:
runs-on: ubuntu-latest
container: registry.opensuse.org/yast/head/containers/yast-ruby:latest

steps:

- name: Git Checkout
uses: actions/checkout@v2

- name: POT Check
run: rake check:pot
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

2 changes: 0 additions & 2 deletions Dockerfile

This file was deleted.

4 changes: 1 addition & 3 deletions src/include/ftp-server/write_load.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ def WriteStartViaSocket(start)
# Convert between the UI (yast), and system (vsftpd, pure_ftpd) settings.
#
# The system settings are multiplexed by
# {FtpServerClass#vsftpd_edit vsftpd_edit}:
# {FtpServerClass#VS_SETTINGS VS_SETTINGS} (for vsftpd_edit == true) or
# {FtpServerClass#PURE_SETTINGS PURE_SETTINGS} (for vsftpd_edit == false).
# {Yast::FtpServerClass#VS_SETTINGS VS_SETTINGS}
#
# @param [String] key
# in the {FtpServerClass#EDIT_SETTINGS EDIT_SETTINGS} vocabulary
Expand Down
2 changes: 2 additions & 0 deletions test/modules/ftpserver_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def mock_config(config_path, map)
allow(ftp_server).to receive(:PollAbort).and_return(false)
allow(ftp_server).to receive(:WriteSettings).and_return(true)
allow(ftp_server).to receive(:write_daemon)
allow(Yast::Service).to receive(:active?).with("vsftpd").and_return(false)
allow(Yast::Service).to receive(:restart).with("vsftpd")

ftp_server.main
end
Expand Down
24 changes: 20 additions & 4 deletions test/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ def stub_module(name)

stub_module("Users")

RSpec.configure do |config|
config.mock_with :rspec do |c|
# make sure we mock only the existing methods
# https://relishapp.com/rspec/rspec-mocks/v/3-0/docs/verifying-doubles/partial-doubles
c.verify_partial_doubles = true
end
end

if ENV["COVERAGE"]
require "simplecov"
SimpleCov.start do
Expand All @@ -44,12 +52,20 @@ def stub_module(name)
# track all ruby files under src
SimpleCov.track_files("#{SRC_PATH}/**/*.rb")

# use coveralls for on-line code coverage reporting at Travis CI
if ENV["TRAVIS"]
require "coveralls"
# additionally use the LCOV format for on-line code coverage reporting at CI
if ENV["CI"] || ENV["COVERAGE_LCOV"]
require "simplecov-lcov"

SimpleCov::Formatter::LcovFormatter.config do |c|
c.report_with_single_file = true
# this is the default Coveralls GitHub Action location
# https://github.com/marketplace/actions/coveralls-github-action
c.single_report_path = "coverage/lcov.info"
end

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
SimpleCov::Formatter::LcovFormatter
]
end
end

0 comments on commit 5734821

Please sign in to comment.