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

Allow mocked updates for E2E testing #1654

Merged
merged 7 commits into from
Feb 11, 2022
Merged

Conversation

fhammerl
Copy link
Contributor

@fhammerl fhammerl commented Feb 3, 2022

With this change, you can replace the incoming updateMessage with a custom json map mock_update_messages.json.

Usage

  • Add files like 'runner2.281.2.tar.gz' or 'runner2.283.0.zip' depending on your platform and mock version number in your runner root folder.
  • Set up a json map in mock_update_messages.json, where the key is the version this mock applies to and the value is the mocked update message object (only the targetVersion property matters at the moment), see example test json
  • Set the GITHUB_ACTIONS_RUNNER_IS_MOCK_UPDATE env var to '1'
  • Watch the terminal and update logs to confirm that the mock happened.

@fhammerl fhammerl requested a review from a team as a code owner February 3, 2022 14:54
}
#endif
// archiveFile is not null only if we mocked it above
if (archiveFile == null)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe IsNullOrEmpty to be consistent with the pattern in this file

Copy link
Collaborator

@thboop thboop left a comment

Choose a reason for hiding this comment

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

LGTM

@fhammerl fhammerl merged commit d641909 into main Feb 11, 2022
@fhammerl fhammerl deleted the fhammerl/mock-update-message branch February 11, 2022 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants