Skip to content

Conversation

@xihuan-citrix
Copy link
Contributor

No description provided.

@xihuan-citrix
Copy link
Contributor Author

xihuan-citrix commented May 22, 2024

Hi @xueqingz , could you help to approve the workflows again? I added my signature into the commit to resolve the DSC issue.

@minglumlu minglumlu marked this pull request as draft May 22, 2024 04:10
@xihuan-citrix xihuan-citrix force-pushed the private/xihuany/component_test branch 2 times, most recently from 9364eef to 4634aea Compare May 23, 2024 06:22
@xihuan-citrix xihuan-citrix marked this pull request as ready for review May 24, 2024 01:28
@xihuan-citrix xihuan-citrix force-pushed the private/xihuany/component_test branch from 4634aea to 3e456f7 Compare May 27, 2024 09:08
@xihuan-citrix xihuan-citrix force-pushed the private/xihuany/component_test branch 2 times, most recently from 5383496 to 85fd785 Compare May 28, 2024 06:00
@xihuan-citrix xihuan-citrix force-pushed the private/xihuany/component_test branch from 85fd785 to bb73a64 Compare May 28, 2024 07:18
@xihuan-citrix xihuan-citrix force-pushed the private/xihuany/component_test branch 5 times, most recently from 8ae942c to f9bfb97 Compare May 31, 2024 10:27
@minglumlu
Copy link
Member

The test logs:

+ cd /home/runner/work/xen-api/xen-api/ocaml/sdk-gen/component-test
+ start_jsonrpc_server
+ echo 'Starting JSONRPC server'
+ JSONRPC_SERVER_PID=38861
+ sleep 1
Starting JSONRPC server
+ python3 jsonrpc-server/server.py
+ start_jsonrpc_go_client
Starting JSONRPC Go client
+ echo 'Starting JSONRPC Go client'
+ cd jsonrpc-client/go
+ go mod tidy
go: found xenapi in xenapi v0.0.0-00010101000000-000000000000
+ JSONRPC_GO_CLIENT_PID=38871
+ wait 38871
+ go test -v
=== RUN   TestRpcError
--- PASS: TestRpcError (0.00s)
=== RUN   TestHttpError
--- PASS: TestHttpError (0.00s)
=== RUN   TestXapiError
--- PASS: TestXapiError (0.00s)
=== RUN   TestEventFrom
--- PASS: TestEventFrom (0.00s)
=== RUN   TestLoginSuccess
--- PASS: TestLoginSuccess (0.01s)
=== RUN   TestVMGetAllRecords
--- PASS: TestVMGetAllRecords (0.00s)
=== RUN   TestVMImport
--- PASS: TestVMImport (0.00s)
=== RUN   TestVMRetrieveWlbRecommendations
--- PASS: TestVMRetrieveWlbRecommendations (0.00s)
=== RUN   TestVMMigrateSend
--- PASS: TestVMMigrateSend (0.00s)
=== RUN   TestVMGetDataSources
--- PASS: TestVMGetDataSources (0.00s)
=== RUN   TestVMGetSnapshotTime
--- PASS: TestVMGetSnapshotTime (0.00s)
=== RUN   TestVMQueryDataSource
--- PASS: TestVMQueryDataSource (0.00s)
=== RUN   TestVMAsyncImport
--- PASS: TestVMAsyncImport (0.00s)
=== RUN   TestVMSpecialValue
--- PASS: TestVMSpecialValue (0.00s)
PASS
ok  	github.com/xapi-project/xen-api/sdk-gen/component-test/jsonrpc-client/go	0.027s
+ kill 38861
+ kill 38861 38871

@xihuan-citrix xihuan-citrix force-pushed the private/xihuany/component_test branch from f9bfb97 to 57c89b9 Compare June 2, 2024 15:53
@xihuan-citrix
Copy link
Contributor Author

xihuan-citrix commented Jun 2, 2024

Test Result:

# ./run-tests.sh
+++ dirname ./run-tests.sh
++ cd .
++ pwd
+ SCRIPT_PATH=/root/xen-api/ocaml/sdk-gen/component-test
+ trap 'kill $JSONRPC_SERVER_PID $JSONRPC_GO_CLIENT_PID 2>/dev/null' EXIT
+ main
+ cd /root/xen-api/ocaml/sdk-gen/component-test
+ start_jsonrpc_server
+ echo 'Starting JSONRPC server'
Starting JSONRPC server
+ JSONRPC_SERVER_PID=299071
+ sleep 1
+ python3 jsonrpc-server/server.py
======== Running on http://0.0.0.0:5000 ========
(Press CTRL+C to quit)
+ start_jsonrpc_go_client
+ echo 'Starting JSONRPC Go client'
Starting JSONRPC Go client
+ cd jsonrpc-client/go
+ go mod tidy
+ JSONRPC_GO_CLIENT_PID=299078
+ go test -v
+ wait 299078
=== RUN   TestRpcError
--- PASS: TestRpcError (0.00s)
=== RUN   TestHttpError
--- PASS: TestHttpError (0.00s)
=== RUN   TestXapiError
--- PASS: TestXapiError (0.00s)
=== RUN   TestEventFrom
--- PASS: TestEventFrom (0.00s)
=== RUN   TestLoginSuccess
--- PASS: TestLoginSuccess (0.01s)
=== RUN   TestVMGetAllRecords
--- PASS: TestVMGetAllRecords (0.00s)
=== RUN   TestVMImport
--- PASS: TestVMImport (0.00s)
=== RUN   TestVMRetrieveWlbRecommendations
--- PASS: TestVMRetrieveWlbRecommendations (0.00s)
=== RUN   TestVMMigrateSend
--- PASS: TestVMMigrateSend (0.00s)
=== RUN   TestVMGetDataSources
--- PASS: TestVMGetDataSources (0.00s)
=== RUN   TestVMGetSnapshotTime
--- PASS: TestVMGetSnapshotTime (0.00s)
=== RUN   TestVMQueryDataSource
--- PASS: TestVMQueryDataSource (0.00s)
=== RUN   TestVMAsyncImport
--- PASS: TestVMAsyncImport (0.00s)
=== RUN   TestVMSpecialValue
--- PASS: TestVMSpecialValue (0.00s)
PASS
ok      github.com/xapi-project/xen-api/sdk-gen/component-test/jsonrpc-client/go        0.025s
+ kill 299071
+ kill 299071 299078

Copy link
Member

@minglumlu minglumlu left a comment

Choose a reason for hiding this comment

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

Ensuring single test case in single test spec file will make the test code simpler. This can be mentioned in the document.

Signed-off-by: Xihuan Yang <xihuan.yang@cloud.com>
@xihuan-citrix xihuan-citrix force-pushed the private/xihuany/component_test branch from 57c89b9 to beaaf1c Compare June 3, 2024 04:49
@xihuan-citrix
Copy link
Contributor Author

Ensuring single test case in single test spec file will make the test code simpler. This can be mentioned in the document.
Added

@xihuan-citrix
Copy link
Contributor Author

Test Result:

+ cd /root/xen-api/ocaml/sdk-gen/component-test
+ start_jsonrpc_server
+ echo 'Starting JSONRPC server'
Starting JSONRPC server
+ JSONRPC_SERVER_PID=325268
+ sleep 1
+ python3 jsonrpc-server/server.py
======== Running on http://0.0.0.0:5000 ========
(Press CTRL+C to quit)
+ start_jsonrpc_go_client
+ echo 'Starting JSONRPC Go client'
Starting JSONRPC Go client
+ cd jsonrpc-client/go
+ go mod tidy
+ JSONRPC_GO_CLIENT_PID=325275
+ go test -v
+ wait 325275
=== RUN   TestRpcError
--- PASS: TestRpcError (0.00s)
=== RUN   TestHttpError
--- PASS: TestHttpError (0.00s)
=== RUN   TestXapiError
--- PASS: TestXapiError (0.00s)
=== RUN   TestEventFrom
--- PASS: TestEventFrom (0.00s)
=== RUN   TestLoginSuccess
--- PASS: TestLoginSuccess (0.01s)
=== RUN   TestVMGetAllRecords
--- PASS: TestVMGetAllRecords (0.00s)
=== RUN   TestVMImport
--- PASS: TestVMImport (0.00s)
=== RUN   TestVMRetrieveWlbRecommendations
--- PASS: TestVMRetrieveWlbRecommendations (0.00s)
=== RUN   TestVMMigrateSend
--- PASS: TestVMMigrateSend (0.00s)
=== RUN   TestVMGetDataSources
--- PASS: TestVMGetDataSources (0.00s)
=== RUN   TestVMGetSnapshotTime
--- PASS: TestVMGetSnapshotTime (0.00s)
=== RUN   TestVMQueryDataSource
--- PASS: TestVMQueryDataSource (0.00s)
=== RUN   TestVMAsyncImport
--- PASS: TestVMAsyncImport (0.00s)
=== RUN   TestVMSpecialValue
--- PASS: TestVMSpecialValue (0.00s)
PASS
ok      github.com/xapi-project/xen-api/sdk-gen/component-test/jsonrpc-client/go        0.026s
+ kill 325268
+ kill 325268 325275

@xihuan-citrix xihuan-citrix merged commit ad3c5d1 into xapi-project:feature/go_sdk Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants