learn-test 2.5.6 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +59 -0
- data/.gitignore +0 -1
- data/Gemfile +4 -1
- data/Gemfile.lock +57 -0
- data/LICENSE.txt +1 -1
- data/README.md +2 -3
- data/bin/learn-test +4 -0
- data/learn-test.gemspec +9 -12
- data/lib/learn_test.rb +2 -5
- data/lib/learn_test/js_strategy.rb +7 -3
- data/lib/learn_test/repo_parser.rb +2 -3
- data/lib/learn_test/runner.rb +1 -3
- data/lib/learn_test/strategies/pytest.rb +85 -0
- data/lib/learn_test/strategies/{python_unittest → pytest}/requirements_checker.rb +21 -19
- data/lib/learn_test/strategies/rspec.rb +8 -0
- data/lib/learn_test/username_parser.rb +1 -1
- data/lib/learn_test/version.rb +1 -1
- data/spec/features/rspec_unit_spec.rb +26 -1
- data/spec/fixtures/.netrc +3 -0
- data/spec/fixtures/rspec-unit-spec/spec/dog_spec.rb +8 -0
- data/spec/learn_test/username_parser_spec.rb +61 -0
- data/spec/lib/learn_test/strategies/mocha_spec.rb +20 -17
- metadata +38 -139
- data/lib/learn_test/dependencies/firefox.rb +0 -26
- data/lib/learn_test/dependencies/green_onion.rb +0 -14
- data/lib/learn_test/strategies/green_onion.rb +0 -57
- data/lib/learn_test/strategies/jasmine.rb +0 -181
- data/lib/learn_test/strategies/jasmine/boot.js +0 -184
- data/lib/learn_test/strategies/jasmine/console.js +0 -161
- data/lib/learn_test/strategies/jasmine/formatters/jasmine2-junit.js +0 -199
- data/lib/learn_test/strategies/jasmine/helpers/ConsoleHelper.js +0 -12
- data/lib/learn_test/strategies/jasmine/helpers/ConsoleHelperNoColor.js +0 -12
- data/lib/learn_test/strategies/jasmine/initializer.rb +0 -27
- data/lib/learn_test/strategies/jasmine/jasmine-html.js +0 -360
- data/lib/learn_test/strategies/jasmine/jasmine-jquery.js +0 -813
- data/lib/learn_test/strategies/jasmine/jasmine.css +0 -56
- data/lib/learn_test/strategies/jasmine/jasmine.js +0 -2403
- data/lib/learn_test/strategies/jasmine/jasmine_favicon.png +0 -0
- data/lib/learn_test/strategies/jasmine/jquery-1.8.0.min.js +0 -2
- data/lib/learn_test/strategies/jasmine/jquery-ui-1.8.23.custom.min.js +0 -125
- data/lib/learn_test/strategies/jasmine/runners/SpecRunner.html +0 -35
- data/lib/learn_test/strategies/jasmine/runners/run-jasmine.js +0 -229
- data/lib/learn_test/strategies/jasmine/templates/SpecRunnerTemplate.html.erb +0 -35
- data/lib/learn_test/strategies/jasmine/templates/SpecRunnerTemplateNoColor.html.erb +0 -35
- data/lib/learn_test/strategies/jasmine/templates/requires.yml.example +0 -7
- data/lib/learn_test/strategies/jasmine/vendor/require.js +0 -2077
- data/lib/learn_test/strategies/python_unittest.rb +0 -72
- data/lib/learn_test/strategies/python_unittest/nose_installer.rb +0 -35
- data/spec/features/jasmine_jquery_fixtures_spec.rb +0 -10
- data/spec/fixtures/jasmine-jquery-fixtures/index.html +0 -10
- data/spec/fixtures/jasmine-jquery-fixtures/requires.yml +0 -4
- data/spec/fixtures/jasmine-jquery-fixtures/spec/jasmine-jquery-fixtures-spec.js +0 -11
@@ -1,72 +0,0 @@
|
|
1
|
-
require_relative 'python_unittest/requirements_checker'
|
2
|
-
require_relative 'python_unittest/nose_installer'
|
3
|
-
|
4
|
-
module LearnTest
|
5
|
-
module Strategies
|
6
|
-
class PythonUnittest < LearnTest::Strategy
|
7
|
-
def service_endpoint
|
8
|
-
'/e/flatiron_unittest'
|
9
|
-
end
|
10
|
-
|
11
|
-
def detect
|
12
|
-
test_files.any? {|f| f.match(/.*\.py$/) }
|
13
|
-
end
|
14
|
-
|
15
|
-
def check_dependencies
|
16
|
-
LearnTest::PythonUnittest::RequirementsChecker.check_installation
|
17
|
-
LearnTest::PythonUnittest::NoseInstaller.install
|
18
|
-
end
|
19
|
-
|
20
|
-
def run
|
21
|
-
system("nosetests #{options[:argv].join(' ')} --verbose --with-json --json-file='./.results.json'")
|
22
|
-
end
|
23
|
-
|
24
|
-
def output
|
25
|
-
@output ||= Oj.load(File.read('.results.json'), symbol_keys: true)
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_files
|
29
|
-
@test_files ||= Dir.glob("**/*_test.py")
|
30
|
-
end
|
31
|
-
|
32
|
-
def results
|
33
|
-
{
|
34
|
-
username: username,
|
35
|
-
github_user_id: user_id,
|
36
|
-
learn_oauth_token: learn_oauth_token,
|
37
|
-
repo_name: runner.repo,
|
38
|
-
build: {
|
39
|
-
test_suite: [{
|
40
|
-
framework: 'unittest',
|
41
|
-
formatted_output: output,
|
42
|
-
duration: calculate_duration
|
43
|
-
}]
|
44
|
-
},
|
45
|
-
examples: output[:stats][:total],
|
46
|
-
passing_count: output[:stats][:passes],
|
47
|
-
pending_count: output[:stats][:skipped],
|
48
|
-
failure_count: output[:stats][:errors],
|
49
|
-
failure_descriptions: concat_failure_descriptions
|
50
|
-
}
|
51
|
-
end
|
52
|
-
|
53
|
-
def cleanup
|
54
|
-
FileUtils.rm('.results.json')
|
55
|
-
end
|
56
|
-
|
57
|
-
private
|
58
|
-
|
59
|
-
def calculate_duration
|
60
|
-
output[:results].map do |example|
|
61
|
-
example[:time]
|
62
|
-
end.inject(:+)
|
63
|
-
end
|
64
|
-
|
65
|
-
def concat_failure_descriptions
|
66
|
-
output[:results].select do |example|
|
67
|
-
example[:type] == 'failure'
|
68
|
-
end.map { |ex| ex[:tb] }.join(';')
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module LearnTest
|
2
|
-
module PythonUnittest
|
3
|
-
class NoseInstaller
|
4
|
-
def self.install
|
5
|
-
new.install
|
6
|
-
end
|
7
|
-
|
8
|
-
def install
|
9
|
-
install_nose
|
10
|
-
install_nose_json
|
11
|
-
end
|
12
|
-
|
13
|
-
def install_nose
|
14
|
-
if !nose_installed?
|
15
|
-
`easy_install nose`
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def nose_installed?
|
20
|
-
!`which nosetests`.empty?
|
21
|
-
end
|
22
|
-
|
23
|
-
def install_nose_json
|
24
|
-
if !nose_json_installed?
|
25
|
-
`pip install nose-json`
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def nose_json_installed?
|
30
|
-
!`pip show nose-json`.empty?
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
@@ -1,10 +0,0 @@
|
|
1
|
-
describe "Running a Jasmine jQuery Specs with Fixtures" do
|
2
|
-
context 'without a browser through PhantomJS' do
|
3
|
-
xit 'runs the spec with 0 failures' do
|
4
|
-
output = `cd ./spec/fixtures/jasmine-jquery-fixtures && ./../../../bin/learn-test --local --test`
|
5
|
-
|
6
|
-
expect(output).to include('1 spec, 0 failures')
|
7
|
-
expect(output).to_not include('1 failures')
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
'use-strict';
|
2
|
-
|
3
|
-
describe('Using a local HTML fixture with jQuery', function() {
|
4
|
-
beforeEach(function() {
|
5
|
-
loadFixtures('index.html');
|
6
|
-
});
|
7
|
-
|
8
|
-
it('can use jQuery against a local fixture', function() {
|
9
|
-
expect($('h1').text()).toBe('Hello World');
|
10
|
-
});
|
11
|
-
});
|