Draft: Fix flaky tests for CI Lint page
What does this MR do?
This doesn't work yet, logs from my local:
Failures:
1) CI Lint YAML parsing behaves like validates the YAML YAML is correct parses Yaml and displays the jobs
Got 1 failure and 1 other error:
Shared Example Group: "validates the YAML" called from ./spec/features/projects/ci/lint_spec.rb:56
1.1) Failure/Error: expect(editor_get_value).to have_content(yaml_content)
expected to find text "image: ruby:2.6\nservices:\n - postgres\n\nbefore_script:\n - bundle install\n - bundle exec rake db:create\n\nvariables:\n DB_NAME: postgres\n\ntypes:\n - test\n - deploy\n - notify\n\nrspec:\n script: \"rake spec\"\n tags:\n - ruby\n - postgres\n only:\n - branches\n\nspinach:\n script: \"rake spinach\"\n allow_failure: true\n tags:\n - ruby\n - mysql\n except:\n - tags\n\nstaging:\n variables:\n KEY1: value1\n KEY2: value2\n script: \"cap deploy stating\"\n type: deploy\n tags:\n - ruby\n - mysql\n except:\n - stable\n\nproduction:\n variables:\n DB_NAME: mysql\n type: deploy\n script:\n - cap deploy production\n - cap notify\n tags:\n - ruby\n - mysql\n only:\n - master\n - /^deploy-.*$/\n\ndockerhub:\n type: notify\n script: \"curl http://dockerhub/URL\"\n tags:\n - ruby\n - postgres\n only:\n - branches\n" in "image: ruby:2.6 services: - postgres before_script: - bundle install - bundle exec rake db:create variables: DB_NAME: postgres types: - test - deploy - notify rspec: script: \"rake spec\" tags: - ruby - postgres only: - branches spinach: script: \"rake spinach\" allow_failure: true tags: - ruby - mysql except: - tags staging: variables: KEY1: value1 KEY2: value2 script: \"cap deploy stating\" type: deploy tags: - ruby - mysql except: - stable production: variables: DB_NAME: mysql type: deploy script: - cap deploy production - cap notify tags: - ruby - mysql only: - master - /^deploy-.*$/ dockerhub: type: notify script: \"curl http://dockerhub/URL\" tags: - ruby - postgres only: - branches"
# ./spec/features/projects/ci/lint_spec.rb:32:in `block (5 levels) in <top (required)>'
# ./spec/spec_helper.rb:319:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:310:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:306:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:306:in `block (2 levels) in <top (required)>'
1.2) Failure/Error: raise JSConsoleError, message
JSConsoleError:
Unexpected browser console output:
webpack-internal:////t7P 125:8 "[WDS] Warnings while compiling."
webpack-internal:////t7P 134:10 "./editor/editor_lite.js 62:13-29\nCritical dependency: the request of a dependency is an expression"
# ./spec/support/capybara.rb:172:in `block (2 levels) in <main>'
# ./spec/spec_helper.rb:319:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:310:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:306:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:306:in `block (2 levels) in <top (required)>'
2) CI Lint YAML parsing when Dry Run is checked behaves like validates the YAML YAML is correct parses Yaml and displays the jobs
Got 1 failure and 1 other error:
Shared Example Group: "validates the YAML" called from ./spec/features/projects/ci/lint_spec.rb:63
2.1) Failure/Error: expect(editor_get_value).to have_content(yaml_content)
expected to find text "image: ruby:2.6\nservices:\n - postgres\n\nbefore_script:\n - bundle install\n - bundle exec rake db:create\n\nvariables:\n DB_NAME: postgres\n\ntypes:\n - test\n - deploy\n - notify\n\nrspec:\n script: \"rake spec\"\n tags:\n - ruby\n - postgres\n only:\n - branches\n\nspinach:\n script: \"rake spinach\"\n allow_failure: true\n tags:\n - ruby\n - mysql\n except:\n - tags\n\nstaging:\n variables:\n KEY1: value1\n KEY2: value2\n script: \"cap deploy stating\"\n type: deploy\n tags:\n - ruby\n - mysql\n except:\n - stable\n\nproduction:\n variables:\n DB_NAME: mysql\n type: deploy\n script:\n - cap deploy production\n - cap notify\n tags:\n - ruby\n - mysql\n only:\n - master\n - /^deploy-.*$/\n\ndockerhub:\n type: notify\n script: \"curl http://dockerhub/URL\"\n tags:\n - ruby\n - postgres\n only:\n - branches\n" in "image: ruby:2.6 services: - postgres before_script: - bundle install - bundle exec rake db:create variables: DB_NAME: postgres types: - test - deploy - notify rspec: script: \"rake spec\" tags: - ruby - postgres only: - branches spinach: script: \"rake spinach\" allow_failure: true tags: - ruby - mysql except: - tags staging: variables: KEY1: value1 KEY2: value2 script: \"cap deploy stating\" type: deploy tags: - ruby - mysql except: - stable production: variables: DB_NAME: mysql type: deploy script: - cap deploy production - cap notify tags: - ruby - mysql only: - master - /^deploy-.*$/ dockerhub: type: notify script: \"curl http://dockerhub/URL\" tags: - ruby - postgres only: - branches"
# ./spec/features/projects/ci/lint_spec.rb:32:in `block (5 levels) in <top (required)>'
# ./spec/spec_helper.rb:319:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:310:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:306:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:306:in `block (2 levels) in <top (required)>'
2.2) Failure/Error: raise JSConsoleError, message
JSConsoleError:
Unexpected browser console output:
webpack-internal:////t7P 125:8 "[WDS] Warnings while compiling."
webpack-internal:////t7P 134:10 "./editor/editor_lite.js 62:13-29\nCritical dependency: the request of a dependency is an expression"
webpack-internal:////t7P 125:8 "[WDS] Warnings while compiling."
webpack-internal:////t7P 134:10 "./editor/editor_lite.js 62:13-29\nCritical dependency: the request of a dependency is an expression"
# ./spec/support/capybara.rb:172:in `block (2 levels) in <main>'
# ./spec/spec_helper.rb:319:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:310:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:306:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:306:in `block (2 levels) in <top (required)>'
Finished in 3 minutes 9.2 seconds (files took 57.06 seconds to load)
5 examples, 2 failures
Failed examples:
rspec ./spec/features/projects/ci/lint_spec.rb[1:1:1:1:1] # CI Lint YAML parsing behaves like validates the YAML YAML is correct parses Yaml and displays the jobs
rspec ./spec/features/projects/ci/lint_spec.rb[1:1:2:1:1:1] # CI Lint YAML parsing when Dry Run is checked behaves like validates the YAML YAML is correct parses Yaml and displays the jobs
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Related to #297782 (closed)
Edited by Miguel Rincon