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

Add more testcases. #5

Merged
merged 3 commits into from
May 24, 2018
Merged

Add more testcases. #5

merged 3 commits into from
May 24, 2018

Conversation

Puneetha17
Copy link
Contributor

Signed-off-by: Puneetha puneetha17@gmail.com

Signed-off-by: Puneetha <puneetha17@gmail.com>
@@ -173,6 +186,7 @@ func TestPush(t *testing.T) {

rr := httptest.NewRecorder()
tm := TransactionManager{Enclave: &MockEnclave{}}
//tm := testInit(t)
Copy link
Member

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

)

func TestCreateIpcSocket(t *testing.T) {
listener, err := CreateIpcSocket("data/crux.db")
Copy link
Member

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)
Copy link
Member

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?

Copy link
Contributor Author

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"}
Copy link
Member

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) {
Copy link
Member

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?

Copy link
Contributor Author

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>
@conor10 conor10 merged commit 1df9f4e into web3labs:master May 24, 2018
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.

2 participants