Skip to content

Commit

Permalink
chore: ..
Browse files Browse the repository at this point in the history
  • Loading branch information
zeeshanlakhani committed Oct 8, 2023
1 parent be60d3c commit f6d29a2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,23 @@ jobs:
bin: homestar
name: homestar-FreeBSD-x86_64.tar.gz
command: build
rustflags: "-Ctarget-feature=+crt-static"

- os_name: Linux-x86_64
os: ubuntu-20.04
target: x86_64-unknown-linux-musl
bin: homestar
name: homestar-Linux-x86_64-musl.tar.gz
command: both
rustflags: ""

- os_name: Linux-aarch64
os: ubuntu-20.04
target: aarch64-unknown-linux-musl
bin: homestar
name: homestar-Linux-aarch64-musl.tar.gz
command: both
rustflags: "-Ctarget-feature=+crt-static"

- release_for: Windows-x86_64
os: windows-latest
Expand Down Expand Up @@ -99,6 +102,8 @@ jobs:
- name: Build Binary
uses: houseabsolute/actions-rust-cross@v0
env:
RUSTFLAGS: ${{ matrix.platform.rustflags }}
with:
command: ${{ matrix.platform.command }}
target: ${{ matrix.platform.target }}
Expand Down
1 change: 0 additions & 1 deletion homestar-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ autotests = false
path = "src/lib.rs"
bench = false
doctest = true
crate-type = ["cdylib", "rlib"]

[[bin]]
name = "homestar"
Expand Down
14 changes: 7 additions & 7 deletions homestar-runtime/tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use anyhow::Result;
use assert_cmd::prelude::*;
use once_cell::sync::Lazy;
use predicates::prelude::*;
use retry::{delay::Fixed, retry};
use retry::{delay::Exponential, retry};
use serial_test::file_serial;
use std::{
net::{IpAddr, Ipv4Addr, Ipv6Addr, Shutdown, SocketAddr, TcpStream},
Expand Down Expand Up @@ -144,7 +144,7 @@ fn test_server_serial() -> Result<()> {
.unwrap();

let socket = SocketAddr::new(IpAddr::V6(Ipv6Addr::LOCALHOST), 9991);
let result = retry(Fixed::from_millis(1000).take(10), || {
let result = retry(Exponential::from_millis(1000).take(10), || {
TcpStream::connect(socket).map(|stream| stream.shutdown(Shutdown::Both))
});

Expand Down Expand Up @@ -212,7 +212,7 @@ fn test_workflow_run_serial() -> Result<()> {
.unwrap();

let socket = SocketAddr::new(IpAddr::V6(Ipv6Addr::LOCALHOST), 3030);
let result = retry(Fixed::from_millis(1000).take(30), || {
let result = retry(Exponential::from_millis(1000).take(30), || {
TcpStream::connect(socket).map(|stream| stream.shutdown(Shutdown::Both))
});

Expand Down Expand Up @@ -289,7 +289,7 @@ fn test_daemon_serial() -> Result<()> {
.success();

let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 9997);
let result = retry(Fixed::from_millis(1000).take(10), || {
let result = retry(Exponential::from_millis(1000).take(10), || {
TcpStream::connect(socket).map(|stream| stream.shutdown(Shutdown::Both))
});

Expand Down Expand Up @@ -332,7 +332,7 @@ fn test_signal_kill_serial() -> Result<()> {
.unwrap();

let socket = SocketAddr::new(IpAddr::V6(Ipv6Addr::LOCALHOST), 3030);
let result = retry(Fixed::from_millis(1000).take(10), || {
let result = retry(Exponential::from_millis(1000).take(10), || {
TcpStream::connect(socket).map(|stream| stream.shutdown(Shutdown::Both))
});

Expand Down Expand Up @@ -386,7 +386,7 @@ fn test_server_v4_serial() -> Result<()> {
.unwrap();

let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 9999);
let result = retry(Fixed::from_millis(1000).take(30), || {
let result = retry(Exponential::from_millis(1000).take(30), || {
TcpStream::connect(socket).map(|stream| stream.shutdown(Shutdown::Both))
});

Expand Down Expand Up @@ -443,7 +443,7 @@ fn test_daemon_v4_serial() -> Result<()> {
.success();

let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 9999);
let result = retry(Fixed::from_millis(1000).take(30), || {
let result = retry(Exponential::from_millis(1000).take(30), || {
TcpStream::connect(socket).map(|stream| stream.shutdown(Shutdown::Both))
});

Expand Down
4 changes: 4 additions & 0 deletions homestar-runtime/tests/fixtures/test_v4.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[monitoring]
process_collector_interval = 500
metrics_port = 4010

[node]

[node.network]
Expand Down
4 changes: 2 additions & 2 deletions homestar-runtime/tests/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::utils::{stop_homestar, BIN_NAME};
use anyhow::Result;
use once_cell::sync::Lazy;
use reqwest::StatusCode;
use retry::{delay::Fixed, retry, OperationResult};
use retry::{delay::Exponential, retry, OperationResult};
use serial_test::file_serial;
use std::{
net::{IpAddr, Ipv4Addr, Shutdown, SocketAddr, TcpStream},
Expand All @@ -20,7 +20,7 @@ const METRICS_URL: &str = "http://localhost:4004";
fn test_metrics_serial() -> Result<()> {
fn sample_metrics() -> prometheus_parse::Value {
let body = retry(
Fixed::from_millis(1000).take(10),
Exponential::from_millis(1000).take(10),
|| match reqwest::blocking::get(METRICS_URL) {
Ok(response) => match response.status() {
StatusCode::OK => OperationResult::Ok(response.text()),
Expand Down

0 comments on commit f6d29a2

Please sign in to comment.