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

feat(mutating): Mutate unsigned right-shift operator #3200

Conversation

martincostello
Copy link
Contributor

Add support for mutating to/from the unsigned right-shift operator (>>>).

Original Mutations
>> <<, >>>
<< >>, >>>
>>> <<, >>
>>= <<=, >>>=
<<= >>=, >>>=
>>>= <<=, >>=

Add support for mutating to/from the unsigned right-shift operator (`>>>`).
@rouke-broersma rouke-broersma changed the title Mutate unsigned right-shift operator feat(mutating): Mutate unsigned right-shift operator Mar 14, 2025
@rouke-broersma
Copy link
Member

rouke-broersma commented Mar 14, 2025

Thanks! Could you also add a trivial example of this operation to our integration tests?

The operation can go in:
https://github.com/stryker-mutator/stryker-net/blob/master/integrationtest/TargetProjects/NetCore/TargetProject/Constructs/CSharp11.cs

And I would expect that adding the operation changes the total mutants count for the integration test, this can be modified here: https://github.com/stryker-mutator/stryker-net/blob/master/integrationtest/Validation/ValidationProject/ValidateStrykerResults.cs

@martincostello
Copy link
Contributor Author

Thanks - I didn't find that as I assumed everything relevant was in the main Stryker .sln file.

Is there some documentation on how to setup these tests so I can get them passing locally?

If I try to run them as-is, I get errors about missing files:

InitCommandDefaults => Json file missing
CSharp_NetCore_SingleTestProject => System.IO.DirectoryNotFoundException : Could not find a part of the path 'C:\Coding\stryker-mutator\stryker-net\integrationtest\TargetProjects\NetCore\NetCoreTestProject.XUnit\StrykerOutput'.

I assume it involves replicating this?

- name: Pack integration test package
run: dotnet pack ${{ github.workspace }}/src/Stryker.CLI/Stryker.CLI/Stryker.CLI.csproj -p:PackageVersion=$VERSION --output ${{ github.workspace }}/publish
- name: Publish integration test package
run: dotnet nuget push ${{ github.workspace }}/publish/*.nupkg -s $NUGET_FEED -k "$FEEDZ_NUGET_API_KEY"
- name: Install integration test package from feed
run: dotnet tool install dotnet-stryker --tool-path ${{ github.workspace }}/.nuget/tools --version $VERSION --add-source $NUGET_FEED
- name: Run integration test
run: ${{ github.workspace }}/.nuget/tools/dotnet-stryker --dev-mode
working-directory: ${{ github.workspace }}/integrationtest/TargetProjects/NetCore/NetCoreTestProject.XUnit
- name: Validate integration test result
run: dotnet test ${{ github.workspace }}/integrationtest/Validation/ValidationProject --filter Category=SingleTestProject

@martincostello
Copy link
Contributor Author

It's OK, I've reverse engineered it.

I'll push up a commit with a script to make it easier for contributors in the future once I've updated the tests.

Add a pwsh script that can be used to run the integration tests.
Add integration test for `>>` and `>>=`.
@martincostello
Copy link
Contributor Author

Integration tests added.

@martincostello
Copy link
Contributor Author

Looks like I need to update the results for the tests that run in AzDO too.

Update counts for tests that run on macOS and Linux in AzDO.
@martincostello
Copy link
Contributor Author

Fixed.

@rouke-broersma rouke-broersma enabled auto-merge (squash) March 14, 2025 13:50
@rouke-broersma rouke-broersma merged commit f02d015 into stryker-mutator:master Mar 14, 2025
7 checks passed
@martincostello martincostello deleted the unsigned-right-shift-mutation branch March 14, 2025 14:39
martincostello added a commit to martincostello/mutation-testing-elements that referenced this pull request Mar 14, 2025
Add new unsigned right sift and Append/Prepend mutations for Stryker.NET.

See stryker-mutator/stryker-net#3200 and stryker-mutator/stryker-net#3199.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants