Repository navigation
chore: exclude test code from Snyk Code analysis - #41981
Merged
Merged
Conversation
Signed-off-by: Florian Scheuer <florian.scheuer@kiteworks.com>
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
phil-davis
approved these changes
Nov 16, 2026
oc-tmueller
approved these changes
Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
.snykpolicy file at the repository root. Itsexclude.codeblock takes test code out of Snyk Code (static analysis):tests/**— PHP unit tests, acceptance tests, test helpers and CI test configurationapps/*/tests/**— unit tests and JavaScript specs of the bundled appscore/js/tests/**andsettings/tests/**— JavaScript specs of core and of the settings pagesNo product code is excluded. Snyk Open Source is not affected, because
exclude.codeapplies to Snyk Code only.The file is not part of a release: the dist target copies a fixed list of root files (
core_src_filesin theMakefile), and.snykis not on it.Related Issue
Motivation and Context
Snyk Code reports the fixture values in tests (test passwords, dummy tokens) as hard-coded credentials, and the
md5()andsha1()calls that tests use to compute expected path hashes and checksums as weak password hashing. Onmasterthese are 178 of the 256 open low-severity findings. None of the directories is part of a release: the dist target does not copytests/and deletes every othertestsdirectory. The findings therefore carry no risk, and every new test adds more of them. Excluding the test paths keeps the findings list to code that ships.Findings in product code stay visible and are handled one by one through the Snyk ignore approval workflow.
How Has This Been Tested?
master:tests/**andapps/*/tests/**match all 178 findings in test code and none of the 78 others.core/js/tests/**andsettings/tests/**have no open finding today and are listed because they are test directories as well.testsin the repository is covered by one of the four patterns.Types of changes
Checklist: