-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Selenium tests no longer run locally in VS #11342
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
Comments
The motivation for the original issue we were trying to solve (#10504) is that building the repo doesn't require Java and should not need to specify -NoBuildJava. I can look into potential implementations where builds don't check for Java installations but tests will still fail without Java. In the meantime, the expected workflow we had in mind is that you would set |
cc @mkArtakMSFT |
I don’t think it’s ok to have the requirement that people reverse-engineer our build system to figure out what magic environment variables to pass to VS just so they can run tests. It’s not just about engineers at Microsoft - this is meant to be an open source project, which implies external developers should be able to make sense of how to contribute. |
The alternative is that ./build.cmd will fail for everyone working in this repo, even for people working in areas that don't run Seleium tests. Again, I'm not proposing a permanent workflow change, but to unblock, see if setting the environment variable would resolve your issue. I agree that we shouldn't require external developers reverse engineering our builds, but we'll need to investigate possible improvements. Some alternatives that come to mind include add a warning that selenium tests are not running and instructions on how to enable them, or run tests automatically if Java is detected but skip them if Java is not found. |
@JunTaoLuo I thought we agreed earlier to default the flag to a value, which would result simple |
I realized that the solution we were considering probably won't be sufficient. Modifying https://github.com/aspnet/AspNetCore/blob/master/src/Components/build.cmd isn't enough because the actual issue here is test not build. We can run tests in two ways: command line and in VS. If we edited build.cmd and tell devs to test via ./build.cmd -Test, that would fix the command line test workflow but I don't think that's what most people are doing. Also, changing the behaviour of build.cmd will not affect how VS runs tests which is also a requirement here. Hence, I suggested the workaround of setting the environment variable for now while we investigate if there's a better way to implement this. I have made two proposals but open to any other ideas. |
I'm still blocked on this. Setting the environment variable is not enough to make this work.
|
@JunTaoLuo, @dougbu this is still blocking the team. I'm marking this as P0 so it gets enough attention. |
@mkArtakMSFT the logic to detect whether Java is installed (locally or otherwise) is in Bash and PowerShell scripts at the moment, not MSBuild files. That makes detection when running tests in VS a more time-consuming change and I hesitate to prioritize the change this week. Is there a lesser / quicker suggestion that's enough for now? Separately, it's not clear how @rynowak's stack trace relates to enabling Selenium tests. The basic requirements are (a) have Java installed and on |
Adding @pranavkm in case he has some ideas regarding this. |
The way I got the E2E tests running in VS was to modify <SeleniumE2ETestsSupported Condition="'$(SeleniumE2ETestsSupported)' == '' and '$(TargetArchitecture)' != 'arm' and '$(OS)' == 'Windows_NT'">true</SeleniumE2ETestsSupported> (i.e., removing the Obviously I'm not suggesting this is a good solution, just a temporary way to be unblocked. |
Why is BuildJava required in the first place, I might have overlooked the changes when I signed off on them, but if the build doesn't fail without it, there's no reason for it to be there, it only gets in the way. |
@javiercn Basically, this is all about allowing users to not have Java installed if they're working in another part of the repo. |
Do the tests also work for you if you define |
The original issue shows the error anyone without java runs into:
This shows up when you run ./build.cmd in the root if you don't have java installed. |
@JunTaoLuo There is an explicit MSBuild variable to prevent that from happening |
The outcome that I expect for this is that it EnforcePrerequisites is disabled if you do build.cmd from a developer machine and is enabled in all other cases.
|
This change has not only affected the developer experience but also has changed the behavior of some tests. As it has silently disabled running the automation for the E2E tests. As this PR proofs #11602 Given this is the case, we should remove the BuildJava flag and use the EnforcePrerequisites variable instead as described above. I have a change out to remove the check for BuildJava #11603 and will merge once the PR passes, as this has removed coverage from all our E2E tests and that is not acceptable. |
Yes that should work. |
Thanks @javiercn ! |
This is not completely closed. I had to skip the component tests because they hang on the CI |
@javiercn or @JunTaoLuo does #12030 track the remaining work in this area? If yes, please close this one as resolved. If not, please make it clear what will be needed that isn't covered in #12030. |
Actually the tracking issue is #11698. |
I think this was fixed as part of 1480b99 E2E test for components still don't run on the CI |
Maybe I missed a memo about something we're meant to do differently now, but I think this problem was introduced here: f76be64#diff-d25609f62dd6bb91ad82d484d1f32bfc
Since that commit, local builds in VS no longer write the necessary assembly metadata to enable the Selenium tests, so you can't run and debug them from the IDE. We definitely need to be able to do that.
@JunTaoLuo Is there a new and intended way to run those tests from VS? Or am I just doing something wrong?
The text was updated successfully, but these errors were encountered: