Fixing bug where script output would appear twice in task logs #1059
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
While testing out the new event driven tentacle client in Octopus Server, we found that E2E tests were failing because log output was coming through twice.
Results
Before
When the event driven tentacle client work was done, it maintained a quirk with script service V1. The quirk was that calling "Complete Script" could return output. This output had to be written to the Octopus Server task log, but only script service V1 was doing this.
During the refactor, we ended up maintaining the output logging after "Complete Script", but it was put in a common place which will get run for all service types, not just V1.
After
Where we call
OnScriptStatusResponseReceived
after we "Complete Script" is the correct location. However, if we do not receive any output (e.g. if we are the V2 or K8s script service), then we simply do not output the results.We enhanced a test to prove the flaw, and then fixed the test by solving the issue.
How to review this PR
Quality ✔️
Pre-requisites