+
Skip to content

Conversation

smithjilks
Copy link
Contributor

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.

@smithjilks smithjilks force-pushed the cocos-143 branch 2 times, most recently from a2718dd to 1b3520b Compare July 8, 2024 09:31
@SammyOina SammyOina marked this pull request as draft July 8, 2024 10:22
@smithjilks smithjilks self-assigned this Jul 13, 2024
@smithjilks smithjilks requested a review from SammyOina August 28, 2024 09:53
@smithjilks smithjilks marked this pull request as ready for review August 28, 2024 09:53
@smithjilks smithjilks changed the title DRAFT - Add agent service tests Add agent service tests Aug 28, 2024
@smithjilks smithjilks changed the title Add agent service tests COCOS-143 - Add agent service tests Aug 28, 2024
}

func (as *agentService) publishEvent(status string, details json.RawMessage) func() {
st := as.sm.GetState().String()
Copy link
Contributor Author

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"))
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

@SammyOina SammyOina left a comment

Choose a reason for hiding this comment

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

coverage is only about 60% improve to atleast 75-80%
image

go test ./... -coverprofile=cover.out 
go tool cover -html=cover.out

Copy link
Contributor

Choose a reason for hiding this comment

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

should not be tracked

Copy link
Contributor

@SammyOina SammyOina left a comment

Choose a reason for hiding this comment

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

add coverage here

image

@@ -0,0 +1,352 @@
// Copyright (c) Ultraviolet
// SPDX-License-Identifier: Apache-2.0
package agent_test
Copy link
Contributor

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>
Signed-off-by: Jilks Smith <smithjilks@gmail.com>
@smithjilks
Copy link
Contributor Author

Screenshot from 2024-09-10 12-11-53

Copy link
Contributor

@WashingtonKK WashingtonKK left a comment

Choose a reason for hiding this comment

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

image

I still get this when I run the tests locally.

Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

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

LGTM

@drasko drasko merged commit e26deb9 into ultravioletrs:main Sep 12, 2024
1 check passed
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.

Feature: Add agent tests

4 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载