pkg/agent initial tests and other minor improvements#116
Merged
Conversation
2988aa0 to
26f7a8b
Compare
bbccc85 to
ed12f67
Compare
This was referenced Feb 11, 2022
This makes it easier when running agent in the container and also allows testing code paths which reads the files. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
So context can be re-used for API calls etc, as context also provides a done channel, so logic using channels don't have to be changed right now. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
So it can be lowered in unit tests. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
This way, we don't leave running goroutine when Run() context is cancelled. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
d4a0059 to
b79b3d3
Compare
This way, when context is cancelled, we exit the loop gracefully, rather than hanging infinitely. No error returned in this case and is arbitrary, it could as well be an error. However, we actually really wait for both reboot need and reboot permission here, so exiting without error likely make sense here. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
833d8fa to
7331e65
Compare
So we don't end up in unresponsive deadlock. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
As default 'go test' timeout is 10 minutes already, but it won't be able to trigger, as job will be killed before it happens, which makes it difficult to investigate. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
633e7b6 to
0ac5a74
Compare
Member
Author
|
Tests started passing on CI after some timing issues (I suspect CPU on GHA being stalled for some time?). Now tests styling, naming and stability needs to be reviewed, perhaps some tests can be further optimized in regards to execution time or simplicity. |
c38b17a to
ebe512f
Compare
Member
Author
|
The test suite is rather extensive, but I think it's a good start for further refactoring and small features. I'll merge it tomorrow if there is no objections. |
So it can be tested. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
ebe512f to
f208ea3
Compare
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
f208ea3 to
0c8291a
Compare
This was referenced Feb 17, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.