-
Notifications
You must be signed in to change notification settings - Fork 12
COCOS-143 - Add agent service tests #170
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
Conversation
a2718dd
to
1b3520b
Compare
} | ||
|
||
func (as *agentService) publishEvent(status string, details json.RawMessage) func() { | ||
st := as.sm.GetState().String() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolves race condition previously caused by access state directly
} | ||
|
||
f, err := os.Create(filepath.Join(currentDir, "algorithm")) | ||
f, err := os.Create(filepath.Join(currentDir, "algo")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this change done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests fail because algorithm dir already exists in the code base
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test/manual/data/iris.zip
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be tracked
43ac812
to
6f4b5b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agent/service_test.go
Outdated
@@ -0,0 +1,352 @@ | |||
// Copyright (c) Ultraviolet | |||
// SPDX-License-Identifier: Apache-2.0 | |||
package agent_test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use agent package so that you don't have to use new to initilize service or if you need to transition state artificially.
Signed-off-by: Jilks Smith <smithjilks@gmail.com>
Signed-off-by: Jilks Smith <smithjilks@gmail.com>
Signed-off-by: Jilks Smith <smithjilks@gmail.com>
2534cee
to
fa4bdb9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What type of PR is this?
This is an enhancement because it adds agent service tests
What does this do?
Adds agent service tests
Which issue(s) does this PR fix/relate to?
Resolves #143
Have you included tests for your changes?
Yes, I have included tests.
Did you document any new/modified feature?
No, I have not updated the documentation because this change adds test cases for the already documented existing agent feature.