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: add docker test for current protocol(vmess, ss, trojan) #324

Merged
merged 25 commits into from
Mar 28, 2024

Conversation

VendettaReborn
Copy link
Contributor

@VendettaReborn VendettaReborn commented Mar 17, 2024

🤔 This is a ...

  • New feature
  • Bug fix
  • Performance optimization
  • Enhancement feature
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

#246

💡 Background and solution

  • background: currently, there is no verification for the protocol implementations
  • solution: migrate docker test logic in clash.meta to clash-rs

📝 Changelog

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Changelog is provided or not needed

To Be Discussed

  • whether we need this test method
  • should we add some docs or setup codes(to pull the images)
  • whether we should run ignore the docker test in github actions

Copy link
Member

@ibigbug ibigbug left a comment

Choose a reason for hiding this comment

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

thanks!

couple of questions

clash_lib/src/proxy/utils/test_utils/docker_runner.rs Outdated Show resolved Hide resolved
clash_lib/src/proxy/utils/test_utils/docker_runner.rs Outdated Show resolved Hide resolved
clash_lib/src/proxy/utils/test_utils/docker_runner.rs Outdated Show resolved Hide resolved
@ibigbug
Copy link
Member

ibigbug commented Mar 17, 2024

we should also setup Docker on the CI runners?

actually, not necessary https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#tools

VendettaReborn and others added 11 commits March 18, 2024 23:35
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.2 to 4.5.3.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](clap-rs/clap@v4.5.2...v4.5.3)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [h2](https://github.com/hyperium/h2) from 0.4.2 to 0.4.3.
- [Release notes](https://github.com/hyperium/h2/releases)
- [Changelog](https://github.com/hyperium/h2/blob/master/CHANGELOG.md)
- [Commits](hyperium/h2@v0.4.2...v0.4.3)

---
updated-dependencies:
- dependency-name: h2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.77 to 0.1.78.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](dtolnay/async-trait@0.1.77...0.1.78)

---
updated-dependencies:
- dependency-name: async-trait
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.9.32 to 0.9.33.
- [Release notes](https://github.com/dtolnay/serde-yaml/releases)
- [Commits](dtolnay/serde-yaml@0.9.32...0.9.33)

---
updated-dependencies:
- dependency-name: serde_yaml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [brotli](https://github.com/dropbox/rust-brotli) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/dropbox/rust-brotli/releases)
- [Commits](https://github.com/dropbox/rust-brotli/commits)

---
updated-dependencies:
- dependency-name: brotli
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [async-recursion](https://github.com/dcchut/async-recursion) from 1.0.5 to 1.1.0.
- [Release notes](https://github.com/dcchut/async-recursion/releases)
- [Commits](dcchut/async-recursion@v1.0.5...v1.1.0)

---
updated-dependencies:
- dependency-name: async-recursion
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@ibigbug
Copy link
Member

ibigbug commented Mar 19, 2024

btw the cargo fmt is failing

Copy link
Member

@ibigbug ibigbug left a comment

Choose a reason for hiding this comment

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

couple of comments

clash_lib/Cargo.toml Outdated Show resolved Hide resolved
clash_lib/src/proxy/utils/test_utils/docker_runner.rs Outdated Show resolved Hide resolved
clash_lib/src/proxy/utils/test_utils/docker_runner.rs Outdated Show resolved Hide resolved
clash_lib/src/proxy/vmess/mod.rs Outdated Show resolved Hide resolved
clash_lib/src/proxy/utils/test_utils/mod.rs Outdated Show resolved Hide resolved
clash_lib/src/proxy/utils/test_utils/docker_runner.rs Outdated Show resolved Hide resolved
error!("Failed to accept connection: {}", e);
Err(anyhow!("Failed to accept connection: {}", e))
}
loop {
Copy link
Member

Choose a reason for hiding this comment

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

@VendettaReborn this should be a loop

Copy link
Member

Choose a reason for hiding this comment

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

for our case it might be fine as we only have 1 conn.

Copy link
Member

Choose a reason for hiding this comment

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

it was actually failing for me on macos as the proxy server inside container can't connect to the listener outside the vm on the host mac machine

@ibigbug
Copy link
Member

ibigbug commented Mar 26, 2024

the condition is failing on Windows

   2 |  CLASH_RS_CI=true cargo test --all --all-features
     |  ~~~~~~~~~~~~~~~~
     | The term 'CLASH_RS_CI=true' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
     | again.
Error: Process completed with exit code 1.

@VendettaReborn
Copy link
Contributor Author

the condition is failing on Windows

   2 |  CLASH_RS_CI=true cargo test --all --all-features
     |  ~~~~~~~~~~~~~~~~
     | The term 'CLASH_RS_CI=true' is not recognized as a name of a cmdlet, function, script file, or executable
     | program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
     | again.
Error: Process completed with exit code 1.

i see...

@ibigbug ibigbug merged commit aa10b1c into master Mar 28, 2024
15 checks passed
@ibigbug ibigbug deleted the feat/docker_test branch March 28, 2024 11:39
@VendettaReborn VendettaReborn mentioned this pull request Apr 6, 2024
12 tasks
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