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

feat:sealer local e2e test and CI using github action #1922

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

zhy76
Copy link
Member

@zhy76 zhy76 commented Dec 19, 2022

Signed-off-by: zhy76 958474674@qq.com

Describe what this PR does / why we need it

feature:local e2e test and CI using github action

Does this pull request fix one issue?

#1633 #1734

Describe how you did it

Infra using docker and run containers as nodes for sealer e2e test,using github action for sealer CI.

Describe how to verify it

See /test/README.md

Special notes for reviews

Before we use the CI using github aciton feature, please make sure that these three variables: REGISTRY_URL={your registry},
REGISTRY_USERNAME={user name},REGISTRY_PASSWORD={password} have been setted in github's secret (for sealer login and sealer image tests).

@github-actions github-actions bot added e2e-test it needs to run e2e test test labels Dec 19, 2022
@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2022

Codecov Report

Base: 17.47% // Head: 17.47% // No change to project coverage 👍

Coverage data is based on head (6851c41) compared to base (b55f5b5).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1922   +/-   ##
=======================================
  Coverage   17.47%   17.47%           
=======================================
  Files         103      103           
  Lines        9169     9169           
=======================================
  Hits         1602     1602           
  Misses       7355     7355           
  Partials      212      212           
Impacted Files Coverage Δ
utils/ssh/scp.go 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@starnop
Copy link
Collaborator

starnop commented Dec 21, 2022

What's the relationship between this PR and https://github.com/sealerio/sealer/pull/1893?

BTW, please solve the conflict firstly

@starnop starnop closed this Dec 21, 2022
@starnop starnop reopened this Dec 21, 2022
@zhy76
Copy link
Member Author

zhy76 commented Dec 21, 2022

What's the relationship between this PR and https://github.com/sealerio/sealer/pull/1893?

BTW, please solve the conflict firstly

PR #1922 contains PR #1893, so I have closed #1893.

@github-actions github-actions bot added the ImageBuilding related to all staff with image building label Dec 21, 2022
@github-actions github-actions bot removed the ImageBuilding related to all staff with image building label Dec 21, 2022
@zhy76 zhy76 force-pushed the release-test-dev branch 2 times, most recently from 9d5165e to 6851c41 Compare January 7, 2023 15:18
@@ -25,5 +25,5 @@ func CommandSetHostAlias(hostName, ip string) string {
}

func CommandUnSetHostAlias() string {
return fmt.Sprintf(`sed -i "/%s/d" /etc/hosts`, DefaultSealerHostAliasAnnotation)
return fmt.Sprintf(`echo "$(sed "/%s/d" /etc/hosts)" > /etc/hosts`, DefaultSealerHostAliasAnnotation)
Copy link
Collaborator

@starnop starnop Jan 9, 2023

Choose a reason for hiding this comment

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

it's a dangerous operation directly overwrite the entire /etc/hosts file

Copy link
Member Author

@zhy76 zhy76 Jan 9, 2023

Choose a reason for hiding this comment

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

The file /etc/hosts is mounted by docker, which means you are not allowed to change its inode from within docker container, so it will cause error Device or resource busy(see:find-and-sed-string-in-docker-got-error-device-or-resource-busy), when using sealer delete command which will use sed to change /etc/hosts.In fact, the essence of the sed command is not to modify the file, but to create a new file to replace the existing file(just like directly overwrite file?)(see:docker中执行sed), and you can see after sed the inode of the file will be changed which is not allowed in container environment with /etc/hosts.

@zhy76 zhy76 force-pushed the release-test-dev branch 5 times, most recently from 1b0908f to 5a11d61 Compare January 15, 2023 16:52
Signed-off-by: zhy76 <958474674@qq.com>
@zhy76
Copy link
Member Author

zhy76 commented Jan 17, 2023

PTAL

err := testhelper.MarshalYamlToFile(clusterFilePath, cluster)
//convert clusterfilev1 to clusterfilev2
clusterv2 := utils.ConvertV1ClusterToV2Cluster(cluster)
clusterv2.Spec.Env = []string{"env=TestEnv"}
Copy link
Collaborator

Choose a reason for hiding this comment

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

extract env=TestEnv as a common env?

Copy link
Collaborator

@starnop starnop left a comment

Choose a reason for hiding this comment

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

LGTM

@starnop
Copy link
Collaborator

starnop commented Jan 30, 2023

@kakaZhou719 PTAL again. THX

@kakaZhou719 kakaZhou719 merged commit 32c71ec into sealerio:main Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e-test it needs to run e2e test test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants