Skip to content
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

Unit tests for workflow RPC service #248

Merged
merged 5 commits into from
Aug 14, 2020

Conversation

gauravgahlot
Copy link
Contributor

@gauravgahlot gauravgahlot commented Aug 12, 2020

Description

Added tests for the workflow RPC calls

Why is this needed

Unit tests for better code coverage.

How are existing users impacted? What migration steps/scripts do we need?

No impact.

Coverage:

➜ go test -coverprofile coverage.out             
➜ go tool cover -func coverage.out | grep tinkerbell.go 
github.com/tinkerbell/tink/grpc-server/tinkerbell.go:29:	GetWorkflowContexts	0.0%
github.com/tinkerbell/tink/grpc-server/tinkerbell.go:49:	GetWorkflowContextList	91.7%
github.com/tinkerbell/tink/grpc-server/tinkerbell.go:72:	GetWorkflowActions	100.0%
github.com/tinkerbell/tink/grpc-server/tinkerbell.go:81:	ReportActionStatus	86.5%
github.com/tinkerbell/tink/grpc-server/tinkerbell.go:138:	UpdateWorkflowData	100.0%
github.com/tinkerbell/tink/grpc-server/tinkerbell.go:155:	GetWorkflowData		85.7%
github.com/tinkerbell/tink/grpc-server/tinkerbell.go:168:	GetWorkflowMetadata	100.0%
github.com/tinkerbell/tink/grpc-server/tinkerbell.go:177:	GetWorkflowDataVersion	100.0%
github.com/tinkerbell/tink/grpc-server/tinkerbell.go:185:	getWorkflowsForWorker	100.0%
github.com/tinkerbell/tink/grpc-server/tinkerbell.go:196:	getWorkflowActions	100.0%
github.com/tinkerbell/tink/grpc-server/tinkerbell.go:206:	isApplicableToSend	87.5%
github.com/tinkerbell/tink/grpc-server/tinkerbell.go:233:	isLastAction		100.0%

@gauravgahlot gauravgahlot added this to In Progress in Issues List via automation Aug 12, 2020
@gauravgahlot gauravgahlot self-assigned this Aug 12, 2020
@gauravgahlot gauravgahlot force-pushed the workflow-tests branch 3 times, most recently from 97049ef to 13ab44f Compare August 12, 2020 13:35
- GetWorkflowContextList
- GetWorkflowsForWorker
- GetWorkflowData

Signed-off-by: Gaurav Gahlot <gauravgahlot0107@gmail.com>
Signed-off-by: Gaurav Gahlot <gauravgahlot0107@gmail.com>
thebsdbox
thebsdbox previously approved these changes Aug 13, 2020
Copy link
Contributor

@thebsdbox thebsdbox left a comment

Choose a reason for hiding this comment

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

Looks good to me that we're now starting to include tests around the workflow.

- GetWorkflowActions
- ReportActionStatus

Signed-off-by: Gaurav Gahlot <gauravgahlot0107@gmail.com>
- TestUpdateWorkflowData
- TestIsLastAction

Signed-off-by: Gaurav Gahlot <gauravgahlot0107@gmail.com>
- GetWorkflowMetadata
- GetWorkflowDataVersion
- IsApplicableToSend

Signed-off-by: Gaurav Gahlot <gauravgahlot0107@gmail.com>
@gauravgahlot gauravgahlot removed the request for review from Cbkhare August 14, 2020 07:19
@gauravgahlot gauravgahlot added the ready-to-merge Signal to Mergify to merge the PR. label Aug 14, 2020
@mergify mergify bot merged commit 74ef27e into tinkerbell:master Aug 14, 2020
Issues List automation moved this from In Progress to Just shipped Aug 14, 2020
@gauravgahlot gauravgahlot deleted the workflow-tests branch August 14, 2020 07:19
@mmlb mmlb removed the ready-to-merge Signal to Mergify to merge the PR. label Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Issues List
  
Just shipped
Development

Successfully merging this pull request may close these issues.

None yet

3 participants