Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new expect action #501

Closed
wants to merge 11 commits into from
Closed

Add new expect action #501

wants to merge 11 commits into from

Conversation

l50
Copy link
Contributor

@l50 l50 commented Jun 25, 2024

Added:

  • expect.yaml: Added a new expect action example
  • expectstep.go: Introduced ExpectStep for managing expect commands using
    the go-expect library.
  • expectstep_test.go: Added tests for the new ExpectStep functionality.

Changed:

  • .pre-commit-config.yaml: Upgraded pre-commit hooks to v4.6.0.
  • codespell: Updated codespell configuration to skip additional content.
  • go.mod: Updated to Go 1.22.0, added dependencies for go-expect and other
    libraries, and updated existing dependencies.
  • step.go: Added support for parsing ExpectStep actions.

Removed:

  • Removed duplicate go-vet configurations in
    .pre-commit-config.yaml.

actions-user and others added 8 commits June 25, 2024 10:29
…tructs

**Changed:**

- Refactored `expect.yaml` to remove `type` fields from steps.
- Updated `basicstep.go` and `expectstep.go` to remove `type` field from step
  structs and initialization.
- Modified `step.go` to dynamically determine step types without `type` field.
- Enhanced `expectstep_test.go` with additional test cases for ExpectStep.

**Added:**

- Introduced environment and output fields to ExpectStep struct.
- Added error handling for missing responses in ExpectStep validation.

**Removed:**

- Removed redundant log messages from `step.go`.
… attributes.

**Added:**

- Detailed comments for ExpectStep attributes in `expectstep.go`
- Detailed comments for Response attributes in `expectstep.go`
- Detailed comments for all ExpectStep methods in `expectstep.go`
- Check for ambiguous types in ParseAction method of `step.go`
- Additional fields (File, TTP, EditFile) in ParseAction method of `step.go`

**Changed:**

- Renamed error messages in `expectstep.go` to lowercase for consistency
- Updated copyright year in `step.go`
- Refactored comments to adhere to GoDoc standards in `expectstep.go`
**Added:**

- Directory change handling in ExpectStep `Execute` method with defer function
- New test case for ExpectStep with directory change verification
- Cleanup step execution in test cases to verify script removal

**Changed:**

- Refactored `createTestScript` to accept script content as a parameter
- Updated test cases to use dynamic script content
- Adjusted ExpectStep validation to remove redundant comments

**Removed:**

- Removed license header from `expectstep_test.go` for simplicity
@TTPForge-bot TTPForge-bot added area/pre-commit Changes made to pre-commit hooks area/go Changes made to go resources labels Jun 25, 2024
@TTPForge-bot TTPForge-bot added the area/github Changes made to github actions label Jun 25, 2024
@facebook-github-bot
Copy link
Contributor

@l50 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@l50 merged this pull request in 4e68927.

@l50 l50 deleted the expect branch June 26, 2024 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/github Changes made to github actions area/go Changes made to go resources area/pre-commit Changes made to pre-commit hooks cla signed Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants