Skip to content

Commit

Permalink
attempt to fix gha tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromegn committed Aug 21, 2023
1 parent 9bce2fe commit 5129a4e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
7 changes: 7 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
serial-integration = { max-threads = 1 }

[profile.default]
fail-fast = true
failure-output = "immediate-final"
Expand All @@ -9,5 +11,10 @@ fail-fast = false
failure-output = "immediate-final"
slow-timeout = { period = "60s", terminate-after = 2 }

[[profile.ci.overrides]]
filter = 'package(integration-tests)'
test-group = 'serial-integration'
slow-timeout = { period = "120s" }

[profile.ci.junit]
path = "junit.xml"
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ jobs:
cache-on-failure: true

- name: Test with latest nextest release
run: cargo nextest run --workspace --target ${{ matrix.target }}
run: cargo nextest run --profile ci --workspace --target ${{ matrix.target }}
36 changes: 18 additions & 18 deletions crates/corrosion/src/command/consul/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,37 +148,37 @@ async fn setup(
let col_infos: Vec<ColumnInfo> = conn.prepare("PRAGMA table_info(consul_services)")?.query_map([], |row| Ok(ColumnInfo { name: row.get(1)?, kind: row.get(2)? })).map_err(|e| eyre::eyre!("could not query consul_services' table_info: {e}"))?.collect::<Result<Vec<_>, _>>()?;

let expected_cols = [
("node", ColumnType::Text),
("id", ColumnType::Text),
("name", ColumnType::Text),
("tags", ColumnType::Text),
("meta", ColumnType::Text),
("port", ColumnType::Integer),
("address", ColumnType::Text),
("updated_at", ColumnType::Integer),
("node", vec![ColumnType::Text]),
("id", vec![ColumnType::Text]),
("name", vec![ColumnType::Text]),
("tags", vec![ColumnType::Text, ColumnType::Blob]),
("meta", vec![ColumnType::Text, ColumnType::Blob]),
("port", vec![ColumnType::Integer]),
("address", vec![ColumnType::Text]),
("updated_at", vec![ColumnType::Integer]),
];

for (name, kind) in expected_cols {
if col_infos.iter().find(|info| info.name == name && info.kind == kind ).is_none() {
if col_infos.iter().find(|info| info.name == name && kind.contains(&info.kind) ).is_none() {
eyre::bail!("expected a column consul_services.{name} w/ type {kind:?}");
}
}

let col_infos: Vec<ColumnInfo> = conn.prepare("PRAGMA table_info(consul_checks)")?.query_map([], |row| Ok(ColumnInfo { name: row.get(1)?, kind: row.get(2)? })).map_err(|e| eyre::eyre!("could not query consul_checks' table_info: {e}"))?.collect::<Result<Vec<_>, _>>()?;

let expected_cols = [
("node", ColumnType::Text),
("id", ColumnType::Text),
("service_id", ColumnType::Text),
("service_name", ColumnType::Text),
("name", ColumnType::Text),
("status", ColumnType::Text),
("output", ColumnType::Text),
("updated_at", ColumnType::Integer),
("node", vec![ColumnType::Text]),
("id", vec![ColumnType::Text]),
("service_id", vec![ColumnType::Text]),
("service_name", vec![ColumnType::Text]),
("name", vec![ColumnType::Text]),
("status", vec![ColumnType::Text]),
("output", vec![ColumnType::Text]),
("updated_at", vec![ColumnType::Integer]),
];

for (name, kind) in expected_cols {
if col_infos.iter().find(|info| info.name == name && info.kind == kind ).is_none() {
if col_infos.iter().find(|info| info.name == name && kind.contains(&info.kind) ).is_none() {
eyre::bail!("expected a column consul_checks.{name} w/ type {kind:?}");
}
}
Expand Down

0 comments on commit 5129a4e

Please sign in to comment.