Skip to content

Add Verify/FailFast CI template

drew stachon requested to merge rspec-rails-fast-failure-template into master

What does this MR do?

This adds a new Verify CI template to use the TestFileFinder gem in pipelines for merged results.

The job is only included by rules if the pipeline is for merged_result (or merge_train) and there is a modified .rb file.

The job has three cases:

  1. No files produce a matched spec. Sample merge request, pipeline
  2. There is a matched spec to run first, and the specs pass. Sample merge request, pipeline
  3. There is a matched spec to run first, the spec fails, and the second stage is skipped. Sample merge request, pipeline

If there are no Ruby changes, the job is not included. Sample merge request pipeline

This configuration is an MVC for running tests for new and modified files first: #198550 (closed)

Screenshots

A sample filtering of file paths using tff, on the most recent 30 commits to master on this project:

$ git diff --name-only master~30..master
.gitlab/ci/rules.gitlab-ci.yml
CHANGELOG-EE.md
CHANGELOG.md
Gemfile
Gemfile.lock
app/assets/javascripts/clusters_list/components/clusters.vue
app/assets/javascripts/clusters_list/index.js
app/assets/javascripts/clusters_list/store/state.js
app/assets/javascripts/ide/components/repo_editor.vue
app/assets/javascripts/ide/lib/editorconfig/parser.js
app/assets/javascripts/ide/lib/editorconfig/rules_mapper.js
app/assets/javascripts/ide/stores/index.js
app/assets/javascripts/vue_shared/components/url_sync.vue
app/controllers/groups_controller.rb
app/controllers/projects_controller.rb
app/controllers/registrations_controller.rb
app/graphql/types/project_type.rb
app/graphql/types/snippet_type.rb
app/helpers/clusters_helper.rb
app/helpers/environments_helper.rb
app/models/members/group_member.rb
app/models/merge_request.rb
app/models/project.rb
app/models/project_setting.rb
app/serializers/cluster_entity.rb
app/serializers/cluster_serializer.rb
app/views/clusters/clusters/index.html.haml
app/views/projects/_merge_request_merge_checks_settings.html.haml
changelogs/unreleased/212882-add-instance-variable.yml
changelogs/unreleased/23352-editorconfig.yml
changelogs/unreleased/allow_skipped.yml
changelogs/unreleased/chore-bump-omniauth_openid_connect.yml
changelogs/unreleased/emilyring-cluster-list-refactor-provider-icon.yml
changelogs/unreleased/fj-change-snippet-author-nullable-graphql-type.yml
config/application.rb
config/environments/development.rb
config/environments/production.rb
config/gitlab.yml.example
config/initializers/1_settings.rb
config/initializers/7_redis.rb
config/initializers/action_cable.rb
config/prometheus/self_monitoring_default.yml
db/migrate/20200325094612_add_allow_merge_on_skipped_pipeline_to_project_settings.rb
db/migrate/20200507221434_add_container_registry_features_to_application_settings.rb
db/structure.sql
doc/.vale/gitlab/spelling-exceptions.txt
doc/administration/auth/oidc.md
doc/administration/server_hooks.md
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/index.md
doc/api/groups.md
doc/api/project_repository_storage_moves.md
doc/api/projects.md
doc/ci/docker/using_docker_images.md
doc/ci/examples/artifactory_and_gitlab/index.md
doc/ci/examples/deployment/README.md
doc/ci/examples/deployment/composer-npm-deploy.md
doc/ci/examples/php.md
doc/ci/variables/predefined_variables.md
doc/development/api_styleguide.md
doc/development/creating_enums.md
doc/development/distributed_tracing.md
doc/development/documentation/site_architecture/global_nav.md
doc/development/documentation/site_architecture/index.md
doc/development/documentation/structure.md
doc/development/elasticsearch.md
doc/development/fe_guide/axios.md
$ tff $(git diff --name-only master~30..master)
spec/controllers/groups_controller_spec.rb
spec/controllers/projects_controller_spec.rb
spec/controllers/registrations_controller_spec.rb
spec/graphql/types/project_type_spec.rb
spec/graphql/types/snippet_type_spec.rb
spec/helpers/clusters_helper_spec.rb
spec/helpers/environments_helper_spec.rb
spec/models/members/group_member_spec.rb
spec/models/merge_request_spec.rb
spec/models/project_spec.rb
spec/models/project_setting_spec.rb
spec/serializers/cluster_entity_spec.rb
spec/serializers/cluster_serializer_spec.rb
spec/lib/gitlab/runtime_spec.rb
spec/requests/api/projects_spec.rb
spec/rubocop/cop/migration/add_limit_to_text_columns_spec.rb
spec/rubocop/cop/migration/prevent_strings_spec.rb
spec/services/projects/create_service_spec.rb

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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
Edited by drew stachon

Merge request reports