Skip to content

Commit 2c2dec2

Browse files
authored
Merge branch 'master' into feature/document_conversion
2 parents cf3c093 + 5b0b7aa commit 2c2dec2

157 files changed

Lines changed: 2314 additions & 514 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/check.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,39 @@ jobs:
1212
- uses: actions/checkout@v4
1313
- uses: ruby/setup-ruby@v1
1414
with:
15-
ruby-version: '3.3'
15+
ruby-version: '3.4'
1616
- name: Install gem dependencies
1717
run: |
1818
gem install bundler
1919
bundle config set with 'development'
2020
bundle install --jobs 4 --retry 3
2121
- name: Run RuboCop check
22-
run: rubocop
22+
run: bundle exec rubocop
2323
- name: Check that code 100% documented
2424
run: yardoc . | grep -q '100.00% documented'
2525

26-
run_all_specs_in_default_docker:
26+
run_modified_files_in_default_docker:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout HEAD
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0 # Fetch the full history to access other branches
33+
- name: Fetch master branch
34+
run: git fetch origin master # Fetch the master branch
35+
- name: Running test inside doc-builder-testing
36+
run: |
37+
docker build -t doc-builder-testing .
38+
docker run -t doc-builder-testing in_modified_specs
39+
40+
run_critical_in_default_docker:
2741
runs-on: ubuntu-latest
2842
steps:
2943
- uses: actions/checkout@v4
3044
- name: Running test inside doc-builder-testing
3145
run: |
3246
docker build -t doc-builder-testing .
33-
docker run -t doc-builder-testing
47+
docker run -t doc-builder-testing rspec_critical
3448
3549
run_critical_in_all_dockerfiles:
3650
runs-on: ubuntu-latest
@@ -46,4 +60,4 @@ jobs:
4660
- name: Dockerfile ${{ matrix.dockerfiles }}
4761
run: |
4862
docker build -t doc-builder-testing -f ${{ matrix.dockerfiles }} .
49-
docker run doc-builder-testing
63+
docker run doc-builder-testing rspec_critical

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ inherit_from: .rubocop_todo.yml
77

88
AllCops:
99
NewCops: enable
10-
TargetRubyVersion: 3.0
10+
TargetRubyVersion: 3.4
1111

1212
# Disable this check since we test end-user product
1313
# And do not perform unit-testing of some ruby classes

.rubocop_todo.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2024-07-10 07:39:04 UTC using RuboCop version 1.64.1.
3+
# on 2025-02-27 10:06:14 UTC using RuboCop version 1.72.2.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -11,14 +11,14 @@
1111
Metrics/MethodLength:
1212
Max: 24
1313

14-
# Offense count: 131
14+
# Offense count: 151
1515
# Configuration parameters: CountAsOne.
1616
RSpec/ExampleLength:
17-
Max: 21
17+
Max: 22
1818

19-
# Offense count: 411
19+
# Offense count: 439
2020
# This cop supports safe autocorrection (--autocorrect).
21-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
21+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
2222
# URISchemes: http, https
2323
Layout/LineLength:
2424
Max: 179

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Ability to set Web Builder url via `WEB_BUILDER_URL`
1313
* Add `yamllint` check in CI
1414
* Add `dependabot` check for `GitHub Actions`
15+
* Use `ruby-3.4` as project base
1516

1617
### Changes
1718

@@ -35,3 +36,4 @@
3536
### Fixes
3637

3738
* Fix centos 8 dockerfile
39+
* Run `rubocop` in CI through `bundle exec`

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ruby:3.3
1+
FROM ruby:3.4
22

33
MAINTAINER Pavel.Lobashov "shockwavenn@gmail.com"
44

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# frozen_string_literal: true
22

33
source 'https://rubygems.org'
4+
5+
ruby '>= 3.4.0'
6+
7+
gem 'csv', '~> 3'
48
gem 'jwt'
9+
gem 'logger', '~> 1'
510
gem 'onlyoffice_pdf_parser'
611
gem 'ooxml_parser'
712
gem 'parallel_tests'

Gemfile.lock

Lines changed: 52 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,24 @@ GEM
33
specs:
44
Ascii85 (2.0.1)
55
afm (0.2.2)
6-
ast (2.4.2)
6+
ast (2.4.3)
77
base64 (0.2.0)
8-
bigdecimal (3.1.8)
8+
bigdecimal (3.1.9)
99
childprocess (5.1.0)
1010
logger (~> 1.5)
11-
diff-lcs (1.5.1)
11+
csv (3.3.3)
12+
diff-lcs (1.6.1)
1213
hashery (2.1.2)
1314
image_size (3.4.0)
1415
iniparse (1.5.0)
15-
json (2.7.6)
16-
jwt (2.9.3)
16+
json (2.10.2)
17+
jwt (2.10.1)
1718
base64
18-
language_server-protocol (3.17.0.3)
19-
logger (1.6.1)
20-
mini_portile2 (2.8.7)
21-
nokogiri (1.16.7)
19+
language_server-protocol (3.17.0.4)
20+
lint_roller (1.1.0)
21+
logger (1.7.0)
22+
mini_portile2 (2.8.8)
23+
nokogiri (1.18.7)
2224
mini_portile2 (~> 2.8.2)
2325
racc (~> 1.4)
2426
observer (0.1.2)
@@ -29,82 +31,92 @@ GEM
2931
ooxml_decrypt (1.0.0)
3032
nokogiri (~> 1.10)
3133
ruby-ole (~> 1.2)
32-
ooxml_parser (0.37.1)
34+
ooxml_parser (0.38.0)
3335
nokogiri (~> 1)
3436
ooxml_decrypt (~> 1)
3537
rubyzip (~> 2)
36-
overcommit (0.64.1)
38+
overcommit (0.67.1)
3739
childprocess (>= 0.6.3, < 6)
3840
iniparse (~> 1.4)
3941
rexml (>= 3.3.9)
4042
parallel (1.26.3)
41-
parallel_tests (4.7.2)
43+
parallel_tests (5.1.0)
4244
parallel
43-
parser (3.3.6.0)
45+
parser (3.3.7.4)
4446
ast (~> 2.4.1)
4547
racc
46-
pdf-reader (2.13.0)
48+
pdf-reader (2.14.1)
4749
Ascii85 (>= 1.0, < 3.0, != 2.0.0)
4850
afm (~> 0.2.1)
4951
hashery (~> 2.0)
5052
ruby-rc4
5153
ttfunk
52-
pkg-config (1.5.7)
54+
pkg-config (1.6.0)
55+
prism (1.4.0)
5356
racc (1.8.1)
5457
rainbow (3.1.1)
5558
rake (13.2.1)
56-
regexp_parser (2.9.2)
57-
rexml (3.3.9)
58-
rmagick (6.0.1)
59+
regexp_parser (2.10.0)
60+
rexml (3.4.1)
61+
rmagick (6.1.1)
5962
observer (~> 0.1)
6063
pkg-config (~> 1.4)
6164
rspec (3.13.0)
6265
rspec-core (~> 3.13.0)
6366
rspec-expectations (~> 3.13.0)
6467
rspec-mocks (~> 3.13.0)
65-
rspec-core (3.13.2)
68+
rspec-core (3.13.3)
6669
rspec-support (~> 3.13.0)
6770
rspec-expectations (3.13.3)
6871
diff-lcs (>= 1.2.0, < 2.0)
6972
rspec-support (~> 3.13.0)
7073
rspec-mocks (3.13.2)
7174
diff-lcs (>= 1.2.0, < 2.0)
7275
rspec-support (~> 3.13.0)
73-
rspec-support (3.13.1)
74-
rubocop (1.68.0)
76+
rspec-support (3.13.2)
77+
rubocop (1.75.2)
7578
json (~> 2.3)
76-
language_server-protocol (>= 3.17.0)
79+
language_server-protocol (~> 3.17.0.2)
80+
lint_roller (~> 1.1.0)
7781
parallel (~> 1.10)
7882
parser (>= 3.3.0.2)
7983
rainbow (>= 2.2.2, < 4.0)
80-
regexp_parser (>= 2.4, < 3.0)
81-
rubocop-ast (>= 1.32.2, < 2.0)
84+
regexp_parser (>= 2.9.3, < 3.0)
85+
rubocop-ast (>= 1.44.0, < 2.0)
8286
ruby-progressbar (~> 1.7)
83-
unicode-display_width (>= 2.4.0, < 3.0)
84-
rubocop-ast (1.34.0)
85-
parser (>= 3.3.1.0)
86-
rubocop-performance (1.22.1)
87-
rubocop (>= 1.48.1, < 2.0)
88-
rubocop-ast (>= 1.31.1, < 2.0)
89-
rubocop-rake (0.6.0)
90-
rubocop (~> 1.0)
91-
rubocop-rspec (3.2.0)
92-
rubocop (~> 1.61)
87+
unicode-display_width (>= 2.4.0, < 4.0)
88+
rubocop-ast (1.44.0)
89+
parser (>= 3.3.7.2)
90+
prism (~> 1.4)
91+
rubocop-performance (1.25.0)
92+
lint_roller (~> 1.1)
93+
rubocop (>= 1.75.0, < 2.0)
94+
rubocop-ast (>= 1.38.0, < 2.0)
95+
rubocop-rake (0.7.1)
96+
lint_roller (~> 1.1)
97+
rubocop (>= 1.72.1)
98+
rubocop-rspec (3.5.0)
99+
lint_roller (~> 1.1)
100+
rubocop (~> 1.72, >= 1.72.1)
93101
ruby-ole (1.2.13.1)
94102
ruby-progressbar (1.13.0)
95103
ruby-rc4 (0.1.5)
96-
rubyzip (2.3.2)
104+
rubyzip (2.4.1)
97105
semantic (1.6.1)
98106
ttfunk (1.8.0)
99107
bigdecimal (~> 3.1)
100-
unicode-display_width (2.6.0)
108+
unicode-display_width (3.1.4)
109+
unicode-emoji (~> 4.0, >= 4.0.4)
110+
unicode-emoji (4.0.4)
101111
yard (0.9.37)
102112

103113
PLATFORMS
104114
ruby
105115

106116
DEPENDENCIES
117+
csv (~> 3)
107118
jwt
119+
logger (~> 1)
108120
onlyoffice_pdf_parser
109121
ooxml_parser
110122
overcommit
@@ -118,5 +130,8 @@ DEPENDENCIES
118130
semantic
119131
yard
120132

133+
RUBY VERSION
134+
ruby 3.4.1p0
135+
121136
BUNDLED WITH
122-
2.3.24
137+
2.6.2

README.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# docbuilder-testing
22

3+
[![check](https://github.com/ONLYOFFICE-QA/doc-builder-testing/actions/workflows/check.yml/badge.svg)](https://github.com/ONLYOFFICE-QA/doc-builder-testing/actions/workflows/check.yml)
4+
35
Framework for QA of `onlyoffice-documentbuilder`
46

57
## Configuration
@@ -14,6 +16,16 @@ Framework for QA of `onlyoffice-documentbuilder`
1416
| | docx | docxf | docm | dotm | dotx | epub | fb2 | html | odt | ott | pdf | pdfa | rtf | txt |
1517
| docx | * | * | * | * | * | * | * | * | * | * | * | * | * | * |
1618

19+
## Windows
20+
21+
* Install native docbuilder to `C:\`
22+
23+
```shell
24+
bundle install
25+
rake run_test_on_win
26+
```
27+
28+
1729
## Project Information
1830

1931
[Official website](https://www.onlyoffice.com)
@@ -26,19 +38,3 @@ Framework for QA of `onlyoffice-documentbuilder`
2638

2739
docbuilder-testing is released under an GNU AGPL v3.0 license.
2840
See the LICENSE file for more information.
29-
30-
## install via windows
31-
32-
* Install desktop builder to `C:\`
33-
34-
* Install dependencies
35-
36-
```shell
37-
bundle install
38-
```
39-
40-
* Run test
41-
42-
```shell
43-
rake run_test_on_win
44-
```

Rakefile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ end
1313
desc 'run parallel_rspec on builder in documentserver'
1414
task :web do
1515
ENV['BUILDER_PLATFORM'] = 'WEB'
16+
doclinux = WebDocBuilderWrapper.new(documentserver_path: 'https://doc-linux.teamlab.info')
17+
kim = WebDocBuilderWrapper.new(documentserver_path: 'https://kim.teamlab.info')
18+
19+
server = doclinux.semver > kim.semver ? doclinux : kim
20+
ENV['WEB_BUILDER_URL'] = server.uri
21+
puts "Run on #{server.uri}, version #{server.version_with_build}"
22+
1623
sh 'bundle exec parallel_rspec --exclude-pattern "spec/python_wrapper/**" spec'
1724
end
1825

@@ -30,3 +37,30 @@ desc 'run project spec'
3037
task :project_spec do
3138
system('bundle exec parallel_rspec project_spec')
3239
end
40+
41+
desc 'run tests in modified specs'
42+
task :in_modified_specs do
43+
run_default = false
44+
45+
# get changes in framework
46+
lib_diff = `git diff --name-only origin/master -- lib dockerfiles Dockerfile Gemfile Gemfile.lock 2>&1`
47+
# check of comparison results/errors
48+
run_default = true if !lib_diff.empty? || lib_diff.include?('fatal:')
49+
50+
# get changes in scripts and find them in spec
51+
scripts_diff = `git diff --name-only origin/master -- js python | xargs -I {} grep -Rl {} spec`
52+
# get changes in spec
53+
spec_diff = `git diff --name-only origin/master -- spec ':!spec/spec_helper.rb' ':!spec/test_data.rb'`
54+
files = spec_diff.split | scripts_diff.split
55+
56+
unless run_default
57+
if files.all? { |element| element =~ %r{^spec/.*\.rb} }
58+
files.empty? ? print('NO TESTS TO RUN.') : sh("bundle exec parallel_rspec #{files.join(' ')}")
59+
else
60+
print("An incorrect file type for rspec has been detected: #{files}")
61+
run_default = true
62+
end
63+
end
64+
65+
Rake::Task['default'].invoke if run_default
66+
end
25.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)