Skip to content

feat: add in new k6 tests#2319

Open
berryware wants to merge 1 commit intohiero-ledger:mainfrom
berryware:2228-K6-server-status-details
Open

feat: add in new k6 tests#2319
berryware wants to merge 1 commit intohiero-ledger:mainfrom
berryware:2228-K6-server-status-details

Conversation

@berryware
Copy link
Contributor

add in tests for serverStatusDetail
check for errors in tests
ignore StatusDeadlineExceeded errors

@berryware berryware requested review from a team as code owners March 4, 2026 22:28
@berryware berryware requested a review from AlfredoG87 March 4, 2026 22:28
@berryware berryware self-assigned this Mar 4, 2026
@berryware berryware added Tests issue related to enhancing the tests Block Node Issues/PR related to the Block Node. labels Mar 4, 2026
@berryware berryware added this to the 0.30.0 milestone Mar 4, 2026
@berryware berryware force-pushed the 2228-K6-server-status-details branch from 8838d81 to 50e8b35 Compare March 4, 2026 22:30
@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@             Coverage Diff              @@
##               main    #2319      +/-   ##
============================================
- Coverage     80.93%   80.81%   -0.12%     
+ Complexity     1462     1459       -3     
============================================
  Files           139      139              
  Lines          6766     6766              
  Branches        728      728              
============================================
- Hits           5476     5468       -8     
- Misses          968      979      +11     
+ Partials        322      319       -3     

see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

check for errors in tests
ignore StatusDeadlineExceeded errors

____________________________________________________________________
Signed-off-by: berryware <231598+berryware@users.noreply.github.com>
@berryware berryware force-pushed the 2228-K6-server-status-details branch from 50e8b35 to de859a7 Compare March 4, 2026 23:41
Copy link
Contributor

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

Seems reasonable, but why the double error check?

@@ -0,0 +1,58 @@
import {Client, StatusDeadlineExceeded, StatusOK} from 'k6/net/grpc';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import {Client, StatusDeadlineExceeded, StatusOK} from 'k6/net/grpc';
// SPDX-License-Identifier: Apache-2.0
import {Client, StatusDeadlineExceeded, StatusOK} from 'k6/net/grpc';

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to enable spotless for JS also? That would help with items as such, but will also introduce reliable formatting for the code.

check(response, {
'status is OK': (r) => r && r.status === StatusOK,
});
if (response.status !== StatusOK) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: why are we double checking the response?
It seems we expect StatusOK the first time but then not the second time but are curious of the failures the second time?

Copy link
Contributor

@ata-nas ata-nas Mar 5, 2026

Choose a reason for hiding this comment

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

This is one of the many k6 limitations we've hit. As we know, k6 has very poor support for gRPC. An unfortunate reality we have to deal with. There seems to be no issue with the BN itself.

@berryware you can consider to close #1963 also with this PR, as we noted there, this would be our best option, I see you have also updated the server status test as well.

Comment on lines +73 to +79
if [[ $? -ne 0 ]]; then
echo "Server status test FAILED."
# Optional: exit the script with a specific error code
exit 1
else
echo "Server status test PASSED."
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if we should exit here. I did not add an exit first because we are still exploring this, but also, if we exit, we will not give a chance to other tests to run. Maybe a better approach would be to collect results and fail at the end, if any tests have failed, but run everything nonetheless. We will also have an overview of what failed/succeeded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Block Node Issues/PR related to the Block Node. Tests issue related to enhancing the tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants