-
Notifications
You must be signed in to change notification settings - Fork 163
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
Move windows test app to react-native-test-app #552
Conversation
@tido64 Our CI to build the windows test app (fails with this change in a similar way that I see locally.
Looks like either an incorrect |
Did you add |
@
Do I need to do that? I ran |
|
I see, so this change now adds an extra step to run the windows test app kinda like how iOS/macOS need a |
apps/windows/readme.md
Outdated
|
||
``` | ||
cd apps/windows | ||
yarn install-windows-test-app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the yarn windows
command also run install-windows-test-app
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could... I could change the following in our package.json
"windows": "react-native run-windows"
=> "windows" : "install windows-test-app && react-native run-windows"
Just like how I could have done this for the iOS app
"ios": "react-native run-ios ..."
=> "ios": "pod install && react-native run-ios"
Buuuut something felt wrong about running two commands there to me. Not sure if that's mostly unfounded
Regardless, I could see that as a simplifying follow up change where I actually use that fluentui-scripts
package we have to define tasks and run those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tido64 any idea why the CI over here is failing? I tried doing both scripts in yarn windows
but that failed too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comparing with RNTA, one difference I'm seeing is that we are specifying --sln
to help the CLI find the solution. But here, the app builds so I don't think that's it. The other thing we can try is to not specify --release
. I couldn't make that work locally due to some other issue:
$ react-native run-windows --sln windows/Example.sln --release
√ Auto-linking...
Success: No auto-linking changes necessary. (1404ms)
√ Found MSBuild v16.0 at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin (16.7.30523.141)
√ Restoring NuGet packages
√ Found Solution: D:\Source\react-native-test-app\example\windows\Example.sln
i Build configuration: Release
i Build platform: x86
× Building Solution: D:\Source\react-native-test-app\example\node_modules\react-native-windows\PropertySheets\Bu...
× Build failed with message 9>Failed to construct transformer : error : EBUSY: resource busy or locked, open 'D:\Source\react-native-test-app\example\msbuild.ProjectImports.zip' [D:\Source\react-native-test-app\example\node_modules\.generated\windows\ReactTestApp\ReactTestApp.vcxproj]. Check your build configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I found a workaround for the EBUSY error (in microsoft/react-native-windows-samples#174) and finally reproed the issue. We are outputting a .msix
file but @react-native-windows/cli
expects .appx
(submitted a fix here microsoft/react-native-windows#6421). This happens if WindowsTargetPlatformMinVersion
is high enough. Patching it locally, I can get passed the error but I'm hitting some issues with app signing. I can look into it when I have some time later...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will also need this patch: microsoft/react-native-test-app#241. You'll need both this and the @react-native-windows/cli
patch. I don't know if you can bump @react-native-windows/cli
alone. If not, you'll have to look into patching it somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can probably wait till both react-native-test-app
and react-native-windows
bump, and update the dependencies and rerun the CI. In the meantime, I'll try to apply changes locally and see if I can find more issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, both PRs are merged. For the fixes in react-native-test-app
, you should use 0.2.16. The fix in @react-native-windows/cli
is not yet released. It will likely hit 0.64 if I understand the release process correctly.
Just as an update, I'll return to this PR after ##566 is merged, where I also update to use the latest version of RNTA. (man that's a mouthful to type). I'm not sure if this is blocked on |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
…nto windows-test-app
…nto windows-test-app
Ok.. so the process name is "ReactTestApp" on the CI machine, but "FluentTester" on my local machine. Interesting. |
Get-Process | ||
displayName: 'Get List of processes' | ||
|
||
# Kill ReactTestApp, leave server up and running. This was the only way I could get the server continuously running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In PowerShell, wouldn't one use something like Start-Process
to fork a new process? Starting up the test app seems like a really expensive workaround…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't write this, but I think the interntion was to test that the test app does run, and then do other stuff after
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The app gets started, then is immediately killed afterwards. There is no time to test anything. The comment also says "This was the only way I could get the server continuously running".
Pinging @samuelfreiberg, since he wrote it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for such a delayed response, not sure it matters anymore, but I couldn't get the server to run when simply starting it like normal. When using "yarn start" or whatever the command was, it wasn't starting the server. The only way I could get it to run at the time was like this. Running the test app also started the server, but then I had to kill the test app or the E2E tests wouldn't run properly. It was a 'hack' and maybe it's changed now, but it was very strange at the time.
FYI, I'm adding more capabilities to React Native Test App:
|
…nto windows-test-app
I saw, thank you for that! Sorry I have not had the bandwidth to see this PR more as I don't have much bandwidth to fix windows CI errors.It also.... somehow didn't block our update to RN 0.63 which I thought we would need it to update our template app 🤷🏾 |
I'm not too familiar with Metro and some of the other changes in this PR, I'll defer to someone else who might be able to validate these changes better. But most of it looks goof |
Closing because #755 exists and is replacing this PR. |
Platforms Impacted
Description of changes
We use
react-native-test-app
to handle the native code of our android, iOS, and macOS test apps, rather than us creating native projects for each and checking in the native code. As of0.2.0
,react-native-test-app
added support for windows. Let's move move the windows test app to usereact-native-test-app
as well.With this change, all platforms (except win32, which doesn't seem to have any native code anyway) now use
react-native-test-app
. Perhaps we could then combine the test apps back intoapps/fluent-tester
now?Steps:
react-native-test-app
dependency to the windows test apppackage.json
. Make sure it matches the version of the other test apps so that the node module can be hoisted. This also happened to alphabetize thepackage.json
.apps/windows/windows/
except for the.gitignore
app.json
to have a appKey.yarn install-windows-test-app
to generateFluentTester.sln
Now,
yarn windows
should work as expected, meaning our CI should also work as expected.This should close #447
Verification
Built the app on my windows PC.
Pull request checklist
This PR has considered (when applicable):