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

Guanyu/dockerfiles #110

Merged
merged 70 commits into from
Jun 10, 2022
Merged

Guanyu/dockerfiles #110

merged 70 commits into from
Jun 10, 2022

Conversation

JBGYZ
Copy link
Contributor

@JBGYZ JBGYZ commented May 2, 2022

  • Created 2 bash scripts for starting and setting up multiple nodes with docker containers or on local and stock the log files in ./log directory
  • Supported killing a node while testing in scenario test
  • Added an autotest script allowing testing multiple times the same election setting and calculate the success rate at end
  • Reset timeout in services and smart contracts as a function of node number
  • Added pooling mechanism in the scenario test

@CLAassistant
Copy link

CLAassistant commented May 2, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ nkcr
✅ JBGYZ
❌ Guanyu Zhang


Guanyu Zhang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@JBGYZ JBGYZ requested review from emduc, giogio21 and nkcr May 2, 2022 07:29
@coveralls
Copy link

coveralls commented May 2, 2022

Pull Request Test Coverage Report for Build 2417666751

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 8 of 10 (80.0%) changed or added relevant lines in 4 files are covered.
  • 28 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.01%) to 63.504%

Changes Missing Coverage Covered Lines Changed/Added Lines %
services/shuffle/neff/mod.go 2 4 50.0%
Files with Coverage Reduction New Missed Lines %
services/shuffle/neff/handler.go 28 85.19%
Totals Coverage Status
Change from base Build 2410134754: 0.01%
Covered Lines: 3132
Relevant Lines: 4932

💛 - Coveralls

@nkcr nkcr added the tests label May 5, 2022
@JBGYZ JBGYZ requested review from emduc and giogio21 May 30, 2022 14:26
@JBGYZ JBGYZ marked this pull request as ready for review May 30, 2022 14:35
@@ -548,3 +579,99 @@ func getElectionInfo(proxyAddr, electionID string, t *testing.T) ptypes.GetElect
return infoElection

}

// func killNode(proxyArray []string, nodeNub int, t *testing.T) []string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to keep this commented code ?

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 2 functions killNode and restartNode are used to test cases where we kill and restart nodes. But in order to pass CI test, we just use the normal scenario test without killing node. We commented those codes to pass lint.

Copy link
Contributor

Choose a reason for hiding this comment

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

Commenting code is not the best way to pass lint ... ;)
Please un-comment the code and fix the linting error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use this trick

	if false {
		proxyArray = killNode(proxyArray, 3, t)
		restartNode(3, t)
	}

and uncomment functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added new env var KILLNODE to control kill and restart node

Copy link
Contributor

@nkcr nkcr left a comment

Choose a reason for hiding this comment

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

Close to merge! 🎊


}
time.Sleep(time.Second * 5)

// Kill and restart the node, change false to true when we want to use
if false {
Copy link
Contributor

Choose a reason for hiding this comment

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

to be replaced by an env variable:

 if os.GetEnv("KILL_NODE" == "true")

Comment on lines +240 to +241
_, err = io.ReadAll(resp.Body)
require.NoError(t, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

to be removed, if the body is not needed

Copy link
Contributor

@nkcr nkcr left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

6.7% 6.7% Coverage
0.0% 0.0% Duplication

@nkcr nkcr merged commit 99eb93b into main Jun 10, 2022
@nkcr nkcr deleted the guanyu/dockerfiles branch June 10, 2022 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants