Skip to content

Commit

Permalink
E2E: modify a workaround for MySQL tests (#767)
Browse files Browse the repository at this point in the history
* kamu --no-color: added additional force off colors
* KamuCliPuppet::execute_impl(): update RUST_LOG for spawned process
* E2E: Add a temporary workaround for MySQL tests
  • Loading branch information
s373r authored Aug 16, 2024
1 parent 5397384 commit db57cf1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
14 changes: 14 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,25 @@
fail-fast = false

[test-groups]
mysql = { max-threads = 1 } # Explanation below
setup = { max-threads = 1 } # Serialize the setup steps
containerized = { max-threads = 8 } # Don't use too much memory
engine = { max-threads = 2 } # Engine tests are very memory-hungry
database = { max-threads = 8 } # Don't use too much memory

# TODO: Delete this workaround when this PR is merged:
# - Fix: nextest cleanup race condition by bonega
# https://github.com/launchbadge/sqlx/pull/3334
#
# NOTE: There is an incompatibility between nextest and sqlx:
# - nextest implies multiprocessing,
# - while sqlx has a lock on cleanup within the current process
# (https://github.com/launchbadge/sqlx/pull/2640#issuecomment-1659455042).
[[profile.default.overrides]]
filter = "test(::mysql::)"
test-group = "mysql"
retries = { count = 3, backoff = "exponential", delay = "3s" }

[[profile.default.overrides]]
filter = "test(::setup::)"
test-group = "setup"
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Changed
- Upgraded to `datafusion v41` (#713)
### Fixed
- E2E: added additional force off colors to exclude sometimes occurring ANSI color sequences
- E2E: modify a workaround for MySQL tests

## [0.194.1] - 2024-08-14
### Fixed
Expand Down
1 change: 1 addition & 0 deletions src/app/cli/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ fn configure_logging(
.with_span_events(FmtSpan::NEW | FmtSpan::CLOSE)
.with_writer(std::io::stderr)
.pretty()
.with_ansi(!no_color_output)
.init();

return Guards::default();
Expand Down
4 changes: 1 addition & 3 deletions src/e2e/app/cli/common-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ fn kamu_cli_e2e_test_impl(harness_method: &Ident, input: TokenStream) -> TokenSt
}
},
"mysql" => quote! {
// flaky: when running in parallel, errors occur with table not found (or sporadic deadlocks),
// restarting again solves the problem.
#[test_group::group(e2e, database, mysql, flaky, #extra_test_groups)]
#[test_group::group(e2e, database, mysql, #extra_test_groups)]
#[test_log::test(sqlx::test(migrations = "../../../../../migrations/mysql"))]
async fn #test_function_name (mysql_pool: sqlx::MySqlPool) {
KamuCliApiServerHarness::mysql(&mysql_pool, #options )
Expand Down
2 changes: 1 addition & 1 deletion src/utils/kamu-cli-puppet/src/kamu_cli_puppet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl KamuCliPuppet {
{
let mut command = assert_cmd::Command::cargo_bin("kamu-cli").unwrap();

command.env("RUST_LOG", "trace");
command.env("RUST_LOG", "info,sqlx=debug");

command.arg("-v");
command.arg("--no-color");
Expand Down

0 comments on commit db57cf1

Please sign in to comment.