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

chore: use nextest in CI #12955

Merged
merged 13 commits into from
Oct 8, 2023
Merged

Conversation

dantengsky
Copy link
Member

@dantengsky dantengsky commented Sep 21, 2023

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

Use the nextest tool to speed up the execution of unit tests.

CI log shows that with nextest it tasks about 16m to finish the unit tests job, and the execution time is :

Summary [ **170.383s**] 765 tests run: 765 passed, 8 skipped

Not bad, but it could be much better if all of our unit tests can be executed concurrently. However, the current strategy of allocating TCP ports for testing various services is not collision-free. As a result, these tests have to be executed in a serialized manner.

  • For local dev, the behavior of make test is unchanged, just plain cargo test

    to use the nextest tool for local dev:

    install cargo-nextest and cargo nextest run

  • To prevent flaky behaviors, the following test cases/suites are carried out sequentially:

$ cargo nextest show-config test-groups
    Finished test [unoptimized + debuginfo] target(s) in 0.52s
group: serial-integration (max threads = 1)
  * override for default profile with filter 'package(databend-meta)':
      databend-meta::it:
          api::http::cluster_state_test::test_cluster_nodes
          api::http::cluster_state_test::test_cluster_state
          api::http::cluster_state_test::test_http_service_cluster_state
          api::http::config::test_config
          api::http::metrics::test_metrics
          api::http_service::test_http_service_tls_server
          configs::test_load_config
          configs::test_tls_rpc_enabled
          grpc::metasrv_connection_error::test_metasrv_connection_error
          grpc::metasrv_connection_error::test_metasrv_one_client_follower_down
          grpc::metasrv_connection_error::test_metasrv_one_client_leader_down
          grpc::metasrv_grpc_api::test_auto_sync_addr
          grpc::metasrv_grpc_api::test_join
          grpc::metasrv_grpc_api::test_restart
          grpc::metasrv_grpc_api::test_retry_join
          grpc::metasrv_grpc_export::test_export
          grpc::metasrv_grpc_get_client_info::test_get_client_info
          grpc::metasrv_grpc_handshake::test_metasrv_handshake
          grpc::metasrv_grpc_kv_api::test_metasrv_kv_api
          grpc::metasrv_grpc_kv_api_restart_cluster::test_kv_api_restart_cluster_token_expired
          grpc::metasrv_grpc_kv_api_restart_cluster::test_kv_api_restart_cluster_write_read
          grpc::metasrv_grpc_schema_api::test_meta_grpc_client_cluster
          grpc::metasrv_grpc_schema_api::test_meta_grpc_client_single
          grpc::metasrv_grpc_schema_api_follower_follower::test_meta_grpc_client_database_create_get_drop
          grpc::metasrv_grpc_schema_api_follower_follower::test_meta_grpc_client_list_database
          grpc::metasrv_grpc_schema_api_follower_follower::test_meta_grpc_client_list_table
          grpc::metasrv_grpc_schema_api_follower_follower::test_meta_grpc_client_table_create_get_drop
          grpc::metasrv_grpc_schema_api_leader_follower::test_meta_api_database_create_get_drop
          grpc::metasrv_grpc_schema_api_leader_follower::test_meta_api_list_database
          grpc::metasrv_grpc_schema_api_leader_follower::test_meta_api_list_table
          grpc::metasrv_grpc_schema_api_leader_follower::test_meta_api_table_create_get_drop
          grpc::metasrv_grpc_tls::test_tls_client_config_failure
          grpc::metasrv_grpc_tls::test_tls_server
          grpc::metasrv_grpc_tls::test_tls_server_config_failure
          grpc::metasrv_grpc_watch::test_watch
          grpc::metasrv_grpc_watch::test_watch_expired_events
          grpc::metasrv_grpc_watch::test_watch_stream_count
          meta_node::meta_node_kv_api::test_meta_node_kv_api
          meta_node::meta_node_kv_api_expire::test_meta_node_replicate_kv_with_expire
          meta_node::meta_node_lifecycle::test_meta_node_boot
          meta_node::meta_node_lifecycle::test_meta_node_graceful_shutdown
          meta_node::meta_node_lifecycle::test_meta_node_join
          meta_node::meta_node_lifecycle::test_meta_node_join_rejoin
          meta_node::meta_node_lifecycle::test_meta_node_join_with_state
          meta_node::meta_node_lifecycle::test_meta_node_leave
          meta_node::meta_node_lifecycle::test_meta_node_leave_last_not_allowed
          meta_node::meta_node_lifecycle::test_meta_node_restart
          meta_node::meta_node_lifecycle::test_meta_node_restart_single_node
          meta_node::meta_node_raft_api::test_meta_node_dumping_snapshot_does_not_block_append_entries
          meta_node::meta_node_raft_api::test_meta_node_serializing_snapshot_does_not_block_append_entries
          meta_node::meta_node_replication::test_meta_node_snapshot_replication
          meta_node::meta_node_request_forwarding::test_meta_node_forward_to_leader
          store::test_impl_raft_storage
          store::test_meta_store_build_snapshot
          store::test_meta_store_current_snapshot
          store::test_meta_store_install_snapshot
          store::test_meta_store_restart

  • Closes #issue

This change is Reviewable

@vercel
Copy link

vercel bot commented Sep 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
databend ⬜️ Ignored (Inspect) Visit Preview Oct 8, 2023 0:46am

@dantengsky
Copy link
Member Author

askbend:summary

@databend-bot

This comment was marked as outdated.

@dantengsky
Copy link
Member Author

askbend:summary

@BohuTANG
Copy link
Member

BohuTANG commented Oct 8, 2023

askbend:summary

@databend-bot
Copy link
Member

PR Summary(By llmchain.rs):

  • Addition of Nextest Configuration File
    The project now includes a .config/nextest.toml file, which is a configuration file for the Nextest testing tool. This change suggests a shift in the project's testing strategy, with the introduction of test groups and profile overrides for specific packages.

  • Modification of GitHub Actions Workflow
    The .github/actions/test_unit/action.yml file, which configures a GitHub Actions workflow, has been updated. The 'run' command for the 'cargo' tool has been changed to 'nextest run', indicating a change in the testing approach, likely in conjunction with the addition of the 'nextest.toml' file.

@dantengsky dantengsky marked this pull request as ready for review October 8, 2023 09:54
@dantengsky dantengsky requested a review from everpcpc October 8, 2023 09:54
@github-actions github-actions bot added the pr-chore this PR only has small changes that no need to record, like coding styles. label Oct 8, 2023
@dantengsky dantengsky merged commit ab5bfe8 into databendlabs:main Oct 8, 2023
13 of 15 checks passed
andylokandy pushed a commit to andylokandy/databend that referenced this pull request Nov 27, 2023
* ci: use nextest in CI

* tweak unit tests, adapts to nextest

* fmt code

* hide nextest progress bar

* make lint

* Revert "fmt code"

This reverts commit a23c507.

* Revert "tweak unit tests, adapts to nextest"

This reverts commit 732cf93.

* serialize execution databend-meta

* make lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-chore this PR only has small changes that no need to record, like coding styles.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants