Replies: 4 comments 4 replies
-
hi That being said, what is your intent using |
Beta Was this translation helpful? Give feedback.
-
Thanks for the request for clarification. What I really need is feedback on the changed code only. Ideally only on the lines that have been changed as a compromise to having a full report on all files when a non-cs file is changed. One approach is to script the diff files and pass them to the stryker run as mutate config like:
A similar approach for the Stryker JS in a github workflow, completes in 12-15 (depending on the amount of chnanges) minutes which is acceptable. Stryker.net mutates whole files and even changing two files only, needs about an hour to run. Hope this clarifies my objective. Any suggestions on what to do? |
Beta Was this translation helpful? Give feedback.
-
Thanks. As of today, there is no feature allowing to pick specific source files to be mutated/tested again. The priority for Stryker.Net is report accuracy over speed, that is why it often default to pessimistic view. Alternatively, I suggest dropping the additional timeout settings, it will speed up things a bit. |
Beta Was this translation helpful? Give feedback.
-
What is sort of working for us is running this is a workflow for pull-requests only: - steps:
- name: Get changes
run: |
git fetch origin main
base_commit=$(git rev-parse origin/main)
changed_files=$(git diff --name-only $base_commit HEAD -- "**/*.cs")
formatted_files=""
for file in $changed_files; do
# Ignore any file under backend/Spts.Test
if [[ "$file" != backend/Spts.Test/* ]]; then
# Extract just the file name and prepend '**/'
filename=$(basename "$file")
formatted_files="$formatted_files -m **/$filename"
fi
done
echo "CHANGED_FILES=$formatted_files" >> $GITHUB_ENV
shell: /usr/bin/bash -e {0}
- name: Run stryker.net
run: |
dotnet stryker --config-file:stryker-diff.json ${{ env.CHANGED_FILES }} --output report When run in a pull-request producing 4 filenames changed, it finishes in about one hour. |
Beta Was this translation helpful? Give feedback.
-
We are using Stryker.NET (and Stryker JS) in a fairly large application, where the backend C#/.NET part involves approximately 500 files, 20 000 lines of code and ballpark 1300 xUnit tests. Running a full stryker.NET analysis on this takes about 8 hours on a MacBook pro M3.
Obviously, waiting this long for (otherwise exelent) feedback on the quality of our tests is not ideal. Trying to run any of thits in a github workflow times out on the 6hr limit.
We are trying to use the
since
feature, with reference to the last commit in main, hoping for Stryker to run only on the *.cs files changed since main, but Stryker.NET insists on running all mutations because a non-cs file is changed:Command line for running stryker:
Config file:
Any config settings we are forgetting?
Beta Was this translation helpful? Give feedback.
All reactions