Skip to content

Commit

Permalink
attempt setting up sshd on GitHub CI for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GyulyVGC committed Mar 27, 2024
1 parent f5e949e commit b744ad7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ jobs:
with:
components: rustfmt, clippy

- name: Launch sshd on Linux
if: matrix.os == 'ubuntu'
run: sudo systemctl start ssh

- name: Launch sshd on macOS
if: matrix.os == 'macos'
run: sudo systemsetup -setremotelogin on

- name: fmt
run: cargo fmt --all -- --check
- name: build
Expand Down
18 changes: 12 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,18 @@ mod tests {
use crate::{Listener, Process};
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr};

// #[test]
// fn test_get_all() {
// let listeners = get_all().unwrap();
// assert!(!listeners.is_empty());
// }
//
#[test]
#[cfg(not(target_os = "windows"))]
fn test_get_all() {
let listeners = crate::get_all().unwrap();
assert!(!listeners.is_empty());

println!("----- test_get_all() -----");
for l in listeners {
println!("{l}");
}
}

// #[test]
// fn test_get_processes_by_port() {
// let processes = get_processes_by_port(3306).unwrap();
Expand Down

0 comments on commit b744ad7

Please sign in to comment.