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

Run iOS tests on CI #2405

Merged
merged 40 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3aff5ec
Added building ios tests
LaPeste May 31, 2021
cac5403
First ios run attempt
LaPeste Jun 10, 2021
fa21760
First ios run attempt - 0
LaPeste Jun 10, 2021
b4809ab
Check iphoneToSimulate value
LaPeste Jun 10, 2021
30eac59
Check iphoneToSimulate value - 0
LaPeste Jun 10, 2021
d3e26af
Removed toString from runtimeId
LaPeste Jun 11, 2021
467391d
Properly handled promises
LaPeste Jun 11, 2021
9a4c257
Check command
LaPeste Jun 11, 2021
fb9209f
Fixed string for commands
LaPeste Jun 14, 2021
a918c60
Fixed string for commands - 0
LaPeste Jun 14, 2021
111ae58
Fixed string for commands - 1
LaPeste Jun 14, 2021
c5b6c59
Try to get output out of bash command
LaPeste Jun 14, 2021
82be0ee
action/exec has a broken parser, fall back to default one
LaPeste Jun 14, 2021
0c93d23
Fixed UUID generation
LaPeste Jun 15, 2021
19db6a8
Try to create ios simulator
LaPeste Jun 15, 2021
2ba71d1
Fixed path to Test.iOS.app
LaPeste Jun 16, 2021
ff7570a
Changed runtime format for simctl
LaPeste Jun 16, 2021
756a3ad
Try to run ios sim
LaPeste Jun 16, 2021
11c27c5
Fixed regexp
LaPeste Jun 16, 2021
921ff4c
Add a bunch of console writelines
nirinchev Jun 17, 2021
fe91e0c
Fix for simulator that wasn't starting
LaPeste Jun 17, 2021
1711ff0
Merge branch 'master' into ac/ci-ios-tests
LaPeste Jun 17, 2021
6da1870
Fixed merge issue
LaPeste Jun 17, 2021
d2e091d
Fix again parameter passing for simulator
LaPeste Jun 17, 2021
3e2196d
Cleanup for review
LaPeste Jun 17, 2021
b2cf976
More cleanup
LaPeste Jun 17, 2021
14b5378
Forgotten await
LaPeste Jun 17, 2021
830ad66
Fix uninfered id in simulator command
nirinchev Jun 17, 2021
db9a56c
Revert console writelines
nirinchev Jun 17, 2021
8eaa504
Ready for review
LaPeste Jun 18, 2021
866c1bf
PR feedback
LaPeste Jun 23, 2021
7da864e
Merge branch 'master' into ac/ci-ios-tests
LaPeste Jun 23, 2021
3f1eb15
Fixed test name
LaPeste Jun 23, 2021
cf28443
Removed unused import from action
LaPeste Jun 23, 2021
3fc9cbc
Minor fix
LaPeste Jun 23, 2021
6301a1e
Forgotten part of the minor fix
LaPeste Jun 23, 2021
9c39eb5
More PR feedback
LaPeste Jun 23, 2021
d59dbde
Final PR feedback
LaPeste Jun 24, 2021
4d00259
Removed local action and set the template to point to remote action
LaPeste Jun 24, 2021
07de1f5
First test with remote custom js GH action
LaPeste Jun 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/templates/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,22 @@ jobs:
- name: Run the tests
run: #@ "Tests/Tests.XamarinMac/bin/" + configuration + "/Tests.XamarinMac.app/Contents/MacOS/Tests.XamarinMac --headless --labels=All --result=${{ github.workspace }}/TestResults.macOS.xml"
- #@ publishTestsResults("TestResults.macOS.xml", "Xamarin.macOS")
run-tests-xamarin-ios:
runs-on: macos-latest
name: Test Xamarin.iOS
needs: build-packages
steps:
- #@ template.replace(checkoutCode())
- #@ template.replace(fetchPackageArtifacts())
- #@ msbuild("Tests/Tests.iOS", TargetFrameworkVersion="v1.0", Platform="iPhoneSimulator", RestoreConfigFile="Tests/Test.NuGet.Config", UseRealmNupkgsWithVersion="${{ needs.build-packages.outputs.package_version }}")
- name: Run the tests
uses: realm/ci-actions/run-ios-simulator@v1
with:
appPath: 'Tests/Tests.iOS/bin/iPhoneSimulator/Release/Tests.iOS.app'
bundleId: 'io.realm.dotnettests'
iphoneToSimulate: 'iPhone-8'
arguments: '--headless --resultpath ${{ github.workspace }}/TestResults.iOS.xml'
- #@ publishTestsResults("TestResults.iOS.xml", "Xamarin.iOS")
run-tests-weaver:
runs-on: windows-latest
name: Test Weaver
Expand All @@ -384,7 +400,7 @@ jobs:
run-cleanup:
runs-on: ubuntu-latest
name: Workflow cleanup
needs: [ run-tests-net-framework, run-tests-uwp, run-tests-netcore-net5, run-tests-xamarin-macos, run-tests-weaver, build-packages ]
needs: [ run-tests-net-framework, run-tests-uwp, run-tests-netcore-net5, run-tests-xamarin-macos, run-tests-xamarin-ios, run-tests-weaver, build-packages ]
if: always()
steps:
- #@ template.replace(deleteWrapperBinaries())
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,45 @@ jobs:
files: TestResults.macOS.xml
comment_mode: "off"
check_name: Results Xamarin.macOS
run-tests-xamarin-ios:
runs-on: macos-latest
name: Test Xamarin.iOS
needs: build-packages
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
- name: Register csc problem matcher
run: echo "::add-matcher::.github/problem-matchers/csc.json"
- name: Register msvc problem matcher
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
- name: Fetch Realm
uses: actions/download-artifact@v2
with:
name: Realm.${{ needs.build-packages.outputs.package_version }}.nupkg
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm.Fody
uses: actions/download-artifact@v2
with:
name: Realm.Fody.${{ needs.build-packages.outputs.package_version }}.nupkg
path: ${{ github.workspace }}/Realm/packages/
- name: Build Tests/Tests.iOS
run: msbuild Tests/Tests.iOS -p:Configuration=Release -restore -p:TargetFrameworkVersion=v1.0 -p:Platform=iPhoneSimulator -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }}
- name: Run the tests
uses: realm/ci-actions/run-ios-simulator@v1
with:
appPath: Tests/Tests.iOS/bin/iPhoneSimulator/Release/Tests.iOS.app
bundleId: io.realm.dotnettests
iphoneToSimulate: iPhone-8
arguments: --headless --resultpath ${{ github.workspace }}/TestResults.iOS.xml
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v1
if: always()
with:
files: TestResults.iOS.xml
comment_mode: "off"
check_name: Results Xamarin.iOS
run-tests-weaver:
runs-on: windows-latest
name: Test Weaver
Expand Down Expand Up @@ -579,6 +618,7 @@ jobs:
- run-tests-uwp
- run-tests-netcore-net5
- run-tests-xamarin-macos
- run-tests-xamarin-ios
- run-tests-weaver
- build-packages
if: always()
Expand Down
2 changes: 1 addition & 1 deletion Tests/Tests.iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary
var arguments = NSProcessInfo.ProcessInfo.Arguments
.Select(a => a.Replace("-app-arg=", string.Empty))
.ToArray();

if (arguments.Any("--headless".Equals))
{
options.AutoRun = true;
Expand Down Expand Up @@ -75,7 +76,6 @@ public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary

return Task.CompletedTask;
};

}

nunit.Options = options;
Expand Down