Page 1 of 1

Local build is different from remote build

Posted: Thu Oct 19, 2017 3:30 pm
by DavidHay
When I run locally my build successfully copies files and folders from a TestData folder however, when I run it through the remote agent it does not include a new folder I created. Does anyone know why these build would be different? Also, how do I look at the build report on the remote machine?

Ranorex 7.2.0 Windows 10

I have a post build event:
mkdir "$(TargetDir)/TestData"
xcopy /Y /E "$(ProjectDir)TestData" "$(TargetDir)/TestData"

Re: Local build is different from remote build

Posted: Thu Oct 19, 2017 3:45 pm
by krstcs
1. Are you using a code versioning system (CVS) such as git, SVN, or TFS? If not, you should be. Please stop everything and get a CVS setup ASAP. This is very important!

2. If you are using a CVS, your project files should be copied to the remote host whenever you pull from the repo, so it should be exactly the same as what was last merged into the branch being pulled. If this is an issue, you need to make sure you are on the correct branch and that the repo doesn't have some issue. If this is the case, it's probably a configuration problem.

3. Is all of the data in the TestData folder being copied correctly to the remote system? Did you add the data files to the project repo in your CVS?

4. If all that is correct, are you sure that you're building on the same version of MSBUILD on the remote system?

If none of that helps, can you post your solution so we can look at it? If not, can you post a sample that has the same issues?

Re: Local build is different from remote build

Posted: Thu Oct 19, 2017 4:11 pm
by DavidHay
Thanks for the quick response.

1. We are using git.
2. I am using the Ranorex remote agent for development, which I believe Ranorex builds it locally, zips it to remote machine and runs it. This is the part that appears to be broken.
3. Data was added correctly in CVS.
4. MSBuild should be the same for Ranorex remote agent as it is locally, unless I misunderstand remote agent.

Additional information:
Once the tests are ready, the are pushed to master and run through Jenkins. Jenkins is building this successfully as well and includes the correct test data.

Re: Local build is different from remote build

Posted: Thu Oct 19, 2017 5:26 pm
by krstcs
OK, this is probably a project configuration issue then...

If you are in your local Ranorex Studio and start the test on the remote agent, I believe Ranorex only sends over the parts of the project that are set to be copied to the output folder during the build step (not pre-/post-build!!), but I'm NOT SURE! :D If your data files have not been added to the project/solution through Studio, then they may not be copied to the output folder.

Also, once you DO add them, make sure that they are set to be copied by selecting each one and hitting "F4" then changing "Copy to output directory" to true, if it isn't already. You may also need to do this for the TestData folder itself, but I'm not sure if that will actually work, I haven't tried it...

Re: Local build is different from remote build

Posted: Thu Oct 19, 2017 7:35 pm
by DavidHay
It would be good to get clarification on the remote agent build. I assumed it would use the same build process, and I think it should use the same build process. I will send Ranorex an email to get clarification.

You were correct. The files did not have "Copy to output directory" set to true. Unfortunately that did not fix the problem. I even deleted them and added them back in through Ranorex. The folders do not have that option. I think my solution is in a weird state because even a file I deleted is being copied to the remote machine. I will send Ranorex an email.

Thanks for the information krstcs!

Re: Local build is different from remote build

Posted: Thu Oct 19, 2017 9:36 pm
by krstcs
I would try cleaning the output directory (Build -> Clean Solution in the Ranorex Studio menu). Or you can manually delete the "bin" folder in your project's directory. Then try again and see what happens. Ranorex is not always good about cleaning up old stuff in the output directories. When you see weird things, the first thing to try is a Clean.

Also, my understanding of the Remote Agent is that it builds locally, then zips the build output and copies that zip over to the remote agent, unzips and then runs the executable directly. This means there is no build on the remote system, only a run. It then zips the report and returns it to the local system to display in studio.