Skip to content

Reduce boileplate in session protocol acceptance tests#21631

Merged
adfoster-r7 merged 1 commit into
rapid7:masterfrom
adfoster-r7:reduce-boilerplate-in-acceptance-tests
Jul 1, 2026
Merged

Reduce boileplate in session protocol acceptance tests#21631
adfoster-r7 merged 1 commit into
rapid7:masterfrom
adfoster-r7:reduce-boilerplate-in-acceptance-tests

Conversation

@adfoster-r7

Copy link
Copy Markdown
Contributor

Description

Reduce boilerplate in session protocol acceptance tests

Verification Steps

  • Ensure CI passes

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Thanks for your pull request! As part of our landing process, we manually verify that all modules work as expected.

We've added the additional-testing-required label to indicate that additional testing is required before this pull request can be merged.
For maintainers, this means visiting here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors protocol session acceptance specs to remove duplicated console/test-harness boilerplate by introducing a shared RSpec context and updating multiple protocol acceptance specs to use it.

Changes:

  • Added protocol_session_acceptance shared context containing console setup, test harness, and session/rhost test generation.
  • Updated SSH/SMB/Postgres/MySQL/MSSQL/LDAP acceptance specs to include the shared context and invoke run_protocol_session_tests.
  • Normalized some string literals and added # frozen_string_literal: true to several acceptance spec files.

Impact Analysis:

  • Blast radius: medium; affects all protocol acceptance specs migrated to the shared context (SSH/SMB/Postgres/MySQL/MSSQL/LDAP) and any future specs that adopt it.
  • Data and contract effects: none; test-only refactor, but changes how acceptance test groups and hooks are generated/executed.
  • Rollback and test focus: easy rollback (revert to per-spec boilerplate); focus validation on spec load/execution (ensuring run_protocol_session_tests is callable) and Allure metadata/attachments generation across at least one protocol suite.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
spec/support/acceptance/protocol_session_shared_context.rb New shared context encapsulating console setup, harness, and generated protocol session tests.
spec/acceptance/ssh_spec.rb Migrates SSH acceptance spec to shared context runner.
spec/acceptance/smb_spec.rb Migrates SMB acceptance spec to shared context runner; minor string literal normalization.
spec/acceptance/postgres_spec.rb Migrates Postgres acceptance spec to shared context runner; minor string/comment normalization.
spec/acceptance/mysql_spec.rb Migrates MySQL acceptance spec to shared context runner; minor string literal normalization.
spec/acceptance/mssql_spec.rb Migrates MSSQL acceptance spec to shared context runner; minor string literal normalization.
spec/acceptance/ldap_spec.rb Migrates LDAP acceptance spec to shared context runner.

Comment thread spec/support/acceptance/protocol_session_shared_context.rb Outdated
Comment thread spec/support/acceptance/protocol_session_shared_context.rb
@adfoster-r7 adfoster-r7 force-pushed the reduce-boilerplate-in-acceptance-tests branch from 131ac75 to 0b33e84 Compare July 1, 2026 13:19
@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Metasploit Kanban Jul 1, 2026
@adfoster-r7 adfoster-r7 merged commit 4c6ac2b into rapid7:master Jul 1, 2026
69 checks passed
@adfoster-r7 adfoster-r7 deleted the reduce-boilerplate-in-acceptance-tests branch July 1, 2026 13:39
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Metasploit Kanban Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants