- When you begin and create the first outputs of the scan (For example the build).
- For some reason, before the unit testing, you need to change the folder location.
- When you try to run the tests and end the scan, it fails (because the saved location it’s from the begin step).
What I did:
First was to find a command to change the working directory properly after the begin step and before the end step but I could not find it in any documentation.
Second was to change the working dir parameter inside the .sonarqube/conf to the new location and it doesn’t work very well because it worked just for a copied folder, if you move it to a new location or copy it to a new server in a different location, it’ll not work.
Third one was to change all the generated files with the old location of the working dir parameter to the new one and it returns:
ERROR:Caused by: unexpected error while parsing protobuf file: .sonarqube\out\0\output-cs\file-metadata.pb ERROR: Caused by: Protocol message end-group tag did not match expected tag. ERROR: The SonarQube Scanner did not complete successfully
Do you guys know a better solution to this problem?