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 CI only tests #726

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: llvm-cov
args: --workspace --all-features --all-targets --release --lcov --output-path lcov.info
args: --workspace --all-features --all-targets --release --lcov --output-path lcov.info -- --include-ignored

- name: Upload code coverage
uses: codecov/codecov-action@v3
Expand Down Expand Up @@ -261,7 +261,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: miri
args: test --workspace --all-features miri
args: test --workspace --all-features miri -- --include-ignored

format:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions src/common/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ mod tests {

// this test is platform specific -> should be changed when targetting different platforms
#[test]
#[ignore = "ci"]
fn test_resolve_path() {
let path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";
assert_eq!(
Expand Down
1 change: 1 addition & 0 deletions src/su/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ mod tests {
}

#[test]
#[ignore = "ci"]
fn group_as_non_root() {
let options = get_options(&["-g", "root"]);
let result = SuContext::from_env(options);
Expand Down
2 changes: 2 additions & 0 deletions src/system/audit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ mod test {
use super::*;

#[test]
#[ignore = "ci"]
fn secure_open_is_predictable() {
// /etc/hosts should be readable and "secure" (if this test fails, you have been compromised)
assert!(std::fs::File::open("/etc/hosts").is_ok());
Expand All @@ -121,6 +122,7 @@ mod test {
}

#[test]
#[ignore = "ci"]
fn test_secure_open_cookie_file() {
assert!(secure_open_cookie_file("/etc/hosts").is_err());
}
Expand Down
2 changes: 2 additions & 0 deletions src/system/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,15 @@ mod test {
}

#[test]
#[ignore = "ci"]
fn test_unix_user() {
let user = |name| User::from_name(name).unwrap().unwrap();
test_user(user("root"), "root", 0);
test_user(user("daemon"), "daemon", 1);
}

#[test]
#[ignore = "ci"]
fn test_unix_group() {
let group = |name| Group::from_name(name).unwrap().unwrap();
test_group(group("root"), "root", 0);
Expand Down
1 change: 1 addition & 0 deletions src/system/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ mod tests {
}

#[test]
#[ignore = "ci"]
fn test_get_user_and_group_by_id() {
let fixed_users = &[(0, "root"), (1, "daemon")];
for &(id, name) in fixed_users {
Expand Down