-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add more testcases. #5
Conversation
Signed-off-by: Puneetha <puneetha17@gmail.com>
server/server_test.go
Outdated
@@ -173,6 +186,7 @@ func TestPush(t *testing.T) { | |||
|
|||
rr := httptest.NewRecorder() | |||
tm := TransactionManager{Enclave: &MockEnclave{}} | |||
//tm := testInit(t) |
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.
Please can you remove this line if not used
utils/file_test.go
Outdated
) | ||
|
||
func TestCreateIpcSocket(t *testing.T) { | ||
listener, err := CreateIpcSocket("data/crux.db") |
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 should use a temporary directory for this test, as we need to ensure it is cleaned up after use.
config/config.go
Outdated
@@ -59,6 +59,7 @@ func InitFlags() { | |||
// TLS is not currently supported | |||
|
|||
pflag.CommandLine.AddGoFlagSet(flag.CommandLine) | |||
viper.BindPFlags(pflag.CommandLine) |
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.
As we're doing this in ParseCommandLine() should it be duplicated now?
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.
To Test if the values are initialised correctly, the present configuration is empty as the viper flags are not updated. so edited that function, if the test seems irrelevant, we can avoid the duplication.
server/data/key
Outdated
@@ -0,0 +1 @@ | |||
{"data":{"bytes":"W1n0C+NfjcU/cUBXsP5FQ/frU+qpvKQ7Pi/Mu5Hf/Ic="},"type":"unlocked"} |
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.
What's the motivation for adding keys here?
} | ||
|
||
func TestInit(t *testing.T) { |
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.
This test does appear to be quite complex - are all of the stages really necessary?
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.
The most part of the test is to initialise various components, and now separated a small portion which was irrelevant here.
Signed-off-by: Puneetha <puneetha17@gmail.com>
Signed-off-by: Puneetha <puneetha17@gmail.com>
Signed-off-by: Puneetha puneetha17@gmail.com