Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

.github: add actions for CI and dependency updates #9

Merged
merged 7 commits into from
Oct 4, 2023
Merged

.github: add actions for CI and dependency updates #9

merged 7 commits into from
Oct 4, 2023

Conversation

tamird
Copy link
Contributor

@tamird tamird commented Oct 4, 2023

/cc @ajwerner

tamird added 2 commits October 4, 2023 11:01
Add a basic github actions config to run the tests.
Add a basic dependabot config to keep dependencies up to date.
@tamird
Copy link
Contributor Author

tamird commented Oct 4, 2023

I added some commits to update the dependencies to latest.

Copy link
Owner

@anakryiko anakryiko left a comment

Choose a reason for hiding this comment

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

Something is not right:

$ target/debug/btf dump /boot/vmlinux-$(uname -r)
thread 'main' panicked at 'Mismatch between definition and access of `format`. Could not downcast to btf::DumpFormat, need to downcast to alloc::string::String
', src/main.rs:113:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@tamird
Copy link
Contributor Author

tamird commented Oct 4, 2023

Thanks, sorry about that. i wanted to write an integration test but it seems that there's nothing currently set up for compiling the BTF and then dumping it.

EDIT: the test would look something like:

diff --git a/tests/tests.rs b/tests/tests.rs
new file mode 100644
index 0000000..8fee9f0
--- /dev/null
+++ b/tests/tests.rs
@@ -0,0 +1,43 @@
+#[test]
+fn dump() {
+    let mut cmd = std::process::Command::new(env!("CARGO_BIN_EXE_btf"));
+    let std::process::Output {
+        status,
+        stdout,
+        stderr,
+    } = cmd
+        .arg("dump")
+        .arg(path-to-btf)
+        .output()
+        .unwrap();
+    let stdout = std::str::from_utf8(&stdout);
+    let stderr = std::str::from_utf8(&stderr);
+    assert_eq!(
+        status.code(),
+        Some(0),
+        "{:?} failed: stdout={:?} stderr={:?}",
+        cmd,
+        stdout,
+        stderr
+    );
+}
``

@anakryiko anakryiko merged commit fa800df into anakryiko:master Oct 4, 2023
@anakryiko
Copy link
Owner

Works now, thanks! Do you want me to create a new v0.0.4 release right away?

@tamird tamird deleted the dependabot branch October 5, 2023 01:41
@tamird
Copy link
Contributor Author

tamird commented Oct 5, 2023

Yes, that would be helpful!

@anakryiko
Copy link
Owner

ok, release v0.0.4 is pushed out (https://github.com/anakryiko/btfdump/releases/tag/v0.0.4, https://crates.io/crates/btfdump/0.0.4)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants