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

test: enable marking of failing coverage tests #25671

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions Makefile
Expand Up @@ -226,7 +226,8 @@ coverage-test: coverage-build
$(RM) out/$(BUILDTYPE)/obj.target/node_lib/gen/*.gcda
$(RM) out/$(BUILDTYPE)/obj.target/node_lib/src/*.gcda
$(RM) out/$(BUILDTYPE)/obj.target/node_lib/src/tracing/*.gcda
-NODE_V8_COVERAGE=out/$(BUILDTYPE)/.coverage $(MAKE) $(COVTESTS)
-NODE_V8_COVERAGE=out/$(BUILDTYPE)/.coverage FLAKY_TESTS="dontcare" \
Copy link
Contributor

Choose a reason for hiding this comment

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

is this just to prevent FLAKY_TESTS from being overridden by an environment variable, so that js-native-api.status is used?

Copy link
Member Author

Choose a reason for hiding this comment

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

by default it is "run" which means it will fail if the tests crashes, this means if the test is marked flaky it will still not be marked as failed.

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Can you double check that... Since you are not marking the tests FLAKY? Maybe we should keep this consistent with other CI target and just use dontcare as an override-able default?

  2. Can we now remove the - prefix?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was on the fence on overriding the dontcare. I think I'll remove for now.

In terms of removing - I don't want to do that until we have a job running (similar to the linter) in the main regression job. I want to avoid the case were a test goes in that breaks coverage and then somebody else (people keeing coverage going) are expected to fix it. As soon as we get the coverage check as part of the regression PR then we will remove it.

Copy link
Member Author

Choose a reason for hiding this comment

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

On the dontcare. To clarify I added that when I marked them as FLAKY but that did not actually work because the builds would then always be yellow which I don't think we wanted. Given that we'd probably we probably have to use FAIL or CRASH I removed the setting of dontcare.

TEST_CI_ARGS="$(TEST_CI_ARGS) --type=coverage" $(MAKE) $(COVTESTS)
$(MAKE) coverage-report-js
-(cd out && "../gcovr/scripts/gcovr" --gcov-exclude='.*deps' \
--gcov-exclude='.*usr' -v -r Release/obj.target \
Expand Down Expand Up @@ -277,7 +278,7 @@ coverage-run-js:
$(RM) -r out/$(BUILDTYPE)/.coverage
$(MAKE) coverage-build-js
-NODE_V8_COVERAGE=out/$(BUILDTYPE)/.coverage CI_SKIP_TESTS=$(COV_SKIP_TESTS) \
$(MAKE) jstest
TEST_CI_ARGS="$(TEST_CI_ARGS) --type=coverage" $(MAKE) jstest
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would probably make sense to also specify:

FLAKY_TESTS="dontcare"

Copy link
Member Author

Choose a reason for hiding this comment

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

k will add.

Copy link
Member Author

Choose a reason for hiding this comment

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

based on @refack's comment I'll leave out setting dontcare completely for now.

$(MAKE) coverage-report-js

.PHONY: test
Expand Down
25 changes: 25 additions & 0 deletions test/js-native-api/js-native-api.status
@@ -0,0 +1,25 @@
prefix js-native-api

# To mark a test as flaky, list the test name in the appropriate section
# below, without ".js", followed by ": PASS,FLAKY". Example:
# sample-test : PASS,FLAKY

[true] # This section applies to all platforms

[$system==win32]

[$system==linux]

[$system==macos]

[$arch==arm || $arch==arm64]

[$system==solaris] # Also applies to SmartOS

[$system==freebsd]

[$system==aix]

[$type==coverage]
test_function/test: PASS,FAIL,CRASH
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this approach to isolating flaky tests a lot 👍 first saw it in the blink codebase.

Copy link
Contributor

Choose a reason for hiding this comment

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

You might consider putting this in https://github.com/nodejs/node/blob/master/test/root.status
My intuition is that file fit better to represent this is a cross-cutting concern.

Copy link
Member Author

Choose a reason for hiding this comment

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

You learn something new every day. I was not aware of that option. I like having the list in one place so will move there.

test_general/testFinalizer: PASS,FAIL,CRASH
2 changes: 1 addition & 1 deletion tools/test.py
Expand Up @@ -1388,7 +1388,7 @@ def BuildOptions():
help='Send SIGABRT instead of SIGTERM to kill processes that time out',
default=False, action="store_true", dest="abort_on_timeout")
result.add_option("--type",
help="Type of build (simple, fips)",
help="Type of build (simple, fips, coverage)",
default=None)
return result

Expand Down