Skip to content

Commit

Permalink
Use the admin api instead of the import functionality (#2768)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev committed Jan 13, 2022
1 parent 9ee4bb5 commit 8f81332
Show file tree
Hide file tree
Showing 66 changed files with 567 additions and 1,241 deletions.
4 changes: 2 additions & 2 deletions .github/templates/common.lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#@ actionSetupNode = "actions/setup-node@v2"
#@ actionAWSConfigureCredentials = "aws-actions/configure-aws-credentials@v1"
#@ actionReleaseToSlack = "realm/ci-actions/release-to-slack@v3"
#@ actionDeployBaaS = "realm/ci-actions/mdb-realm/deployApps@fe278fedebba5508c052e970fffa099de1285dff"
#@ actionCleanupBaaS = "realm/ci-actions/mdb-realm/cleanup@fe278fedebba5508c052e970fffa099de1285dff"
#@ actionDeployBaaS = "realm/ci-actions/mdb-realm/deployApps@dc200700b8d999a039cddbd7cf6ea365c9792982"
#@ actionCleanupBaaS = "realm/ci-actions/mdb-realm/cleanup@dc200700b8d999a039cddbd7cf6ea365c9792982"

#@ actionDockerLayerCaching = "satackey/action-docker-layer-caching@cc3f3828e75cbb45f0cf5139b95329c88480aa97" #! 0.0.11
#@ actionDockerBuild = "docker/build-push-action@375f72aff65b645c51f122f04a776df8416b222b" #! 2.7.0
Expand Down
18 changes: 9 additions & 9 deletions .github/templates/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#@ cleanupTimeout = 10
#@ baasTimeout = 20
#@ wrappersTimeout = 45
#@ baasTestArgs = " --baasurl=${{ secrets.REALM_BASE_URL }} --baascluster=${{ env.CLUSTER_NAME }} --baasapikey=${{ secrets.ATLAS_PUBLIC_API_KEY }} --baasprivateapikey=${{ secrets.ATLAS_PRIVATE_API_KEY }} --baasprojectid=${{ secrets.ATLAS_PROJECT_ID }}"

#@ def getWrapperBuildCommand(cmd, enableLto = True):
#@ defaultParams = " --configuration=" + configuration
Expand Down Expand Up @@ -45,7 +46,7 @@ with:
runs-on: ubuntu-latest
name: #@ "Deploy MDB Realm for " + name
outputs:
deployedApps: ${{ steps.deploy-mdb-apps.outputs.deployedApps }}
clusterName: ${{ steps.deploy-mdb-apps.outputs.clusterName }}
timeout-minutes: #@ baasTimeout
steps:
- #@ template.replace(checkoutCode(False, False))
Expand All @@ -55,7 +56,6 @@ with:
projectId: ${{ secrets.ATLAS_PROJECT_ID }}
apiKey: ${{ secrets.ATLAS_PUBLIC_API_KEY }}
privateApiKey: ${{ secrets.ATLAS_PRIVATE_API_KEY }}
appsPath: ${{ github.workspace }}/Tests/TestApps
differentiator: #@ name
#@yaml/text-templated-strings
(@= testJobName @):
Expand All @@ -65,7 +65,7 @@ with:
- build-packages
- #@ baasJobName
env:
APPS_CONFIG: #@ "${{ needs.baas-" + name.replace(".", "").replace(" ", "-").lower() + ".outputs.deployedApps }}"
CLUSTER_NAME: #@ "${{ needs.baas-" + name.replace(".", "").replace(" ", "-").lower() + ".outputs.clusterName }}"
timeout-minutes: #@ testTimeout
steps:
- #@ template.replace(checkoutCode())
Expand Down Expand Up @@ -151,7 +151,7 @@ steps:
#@ def netFrameworkTestSteps():
- #@ template.replace(msbuildOnWin("Tests/Realm.Tests", TargetFramework="net461"))
- name: Run the tests
run: #@ "./Tests/Realm.Tests/bin/" + configuration + "/net461/Realm.Tests.exe --result=TestResults.Windows.xml --labels=After --baasurl=${{ secrets.REALM_BASE_URL }}"
run: #@ "./Tests/Realm.Tests/bin/" + configuration + "/net461/Realm.Tests.exe --result=TestResults.Windows.xml --labels=After" + baasTestArgs
- #@ publishTestsResults("TestResults.Windows.xml", ".NET Framework")
#@ end

Expand All @@ -165,15 +165,15 @@ steps:
shell: powershell
- #@ template.replace(msbuildOnWin("Tests/Tests.UWP", AppxBundle="Always", PackageCertificateKeyFile="${{ github.workspace }}\Tests\Tests.UWP\Tests.UWP_TemporaryKey.pfx", PackageCertificatePassword="${{ secrets.Pfx_Password }}", UseDotNetNativeToolchain="false", AppxBundlePlatforms="x64"))
- name: Run the tests
run: ./Tests/Tests.UWP/RunTests.ps1 -BaasUrl ${{ secrets.REALM_BASE_URL }} -BaasApps '${{ env.APPS_CONFIG }}'
run: ./Tests/Tests.UWP/RunTests.ps1 -BaasUrl ${{ secrets.REALM_BASE_URL }} -BaasCluster '${{ env.CLUSTER_NAME }}' -BaasApiKey ${{ secrets.ATLAS_PUBLIC_API_KEY }} -BaasPrivateApiKey ${{ secrets.ATLAS_PRIVATE_API_KEY }} -BaasProjectId ${{ secrets.ATLAS_PROJECT_ID }}
shell: powershell
- #@ publishTestsResults("${{ env.TEST_RESULTS }}", "UWP Managed")
#@ end

#@ def xamarinMacTestSteps():
- #@ msbuild("Tests/Tests.XamarinMac", RestoreConfigFile="Tests/Test.NuGet.Config", UseRealmNupkgsWithVersion="${{ needs.build-packages.outputs.package_version }}")
- name: Run the tests
run: #@ "Tests/Tests.XamarinMac/bin/" + configuration + "/Tests.XamarinMac.app/Contents/MacOS/Tests.XamarinMac --headless --labels=All --baasurl=${{ secrets.REALM_BASE_URL }} --result=${{ github.workspace }}/TestResults.macOS.xml"
run: #@ "Tests/Tests.XamarinMac/bin/" + configuration + "/Tests.XamarinMac.app/Contents/MacOS/Tests.XamarinMac --headless --result=${{ github.workspace }}/TestResults.macOS.xml --labels=All" + baasTestArgs
- #@ publishTestsResults("TestResults.macOS.xml", "Xamarin.macOS")
#@ end

Expand All @@ -185,7 +185,7 @@ steps:
appPath: 'Tests/Tests.iOS/bin/iPhoneSimulator/Release/Tests.iOS.app'
bundleId: 'io.realm.dotnettests'
iphoneToSimulate: 'iPhone-8'
arguments: "--headless --result=${{ github.workspace }}/TestResults.iOS.xml --baasurl=${{ secrets.REALM_BASE_URL }} --baasapps=${{ env.APPS_CONFIG }}"
arguments: #@ "--headless --result=${{ github.workspace }}/TestResults.iOS.xml" + baasTestArgs
- #@ publishTestsResults("TestResults.iOS.xml", "Xamarin.iOS")
#@ end

Expand Down Expand Up @@ -227,7 +227,7 @@ steps:
adb shell pm grant io.realm.xamarintests android.permission.READ_EXTERNAL_STORAGE
adb shell pm grant io.realm.xamarintests android.permission.WRITE_EXTERNAL_STORAGE
echo "--baasurl=${{ secrets.REALM_BASE_URL }} --baasapps=${{ env.APPS_CONFIG }}" > ${{ github.workspace }}/testargs.txt
echo "--baasurl=${{ secrets.REALM_BASE_URL }} --baascluster=${{ env.CLUSTER_NAME }} --baasapikey=${{ secrets.ATLAS_PUBLIC_API_KEY }} --baasprivateapikey=${{ secrets.ATLAS_PRIVATE_API_KEY }} --baasprojectid=${{ secrets.ATLAS_PROJECT_ID }}" > ${{ github.workspace }}/testargs.txt
adb push ${{ github.workspace }}/testargs.txt /storage/emulated/0/RealmTests/testargs.txt
adb shell am instrument -w -r io.realm.xamarintests/.TestRunner
Expand All @@ -250,7 +250,7 @@ steps:
echo "${{ github.workspace }}/tools" >> $GITHUB_PATH
- #@ template.replace(dotnetPublish("Tests/Realm.Tests", "net5.0", { "AdditionalFrameworks": "net5.0" }))
- name: Run the tests
run: ./tools/coverlet ${{ steps.dotnet-publish.outputs.executable-path }} -t ${{ steps.dotnet-publish.outputs.executable-path }}/Realm.Tests -a "--result=TestResults.Linux.xml --labels=After --baasurl=${{ secrets.REALM_BASE_URL }}" -f lcov -o ./report.lcov --exclude '[Realm.Tests]*' --exclude '[Realm.Fody]*'
run: #@ "./tools/coverlet ${{ steps.dotnet-publish.outputs.executable-path }} -t ${{ steps.dotnet-publish.outputs.executable-path }}/Realm.Tests -a '--result=TestResults.Linux.xml --labels=After" + baasTestArgs + "' -f lcov -o ./report.lcov --exclude '[Realm.Tests]*' --exclude '[Realm.Fody]*'"
- name: Publish Coverage
id: publish-coveralls
uses: #@ actionCoveralls
Expand Down
Loading

0 comments on commit 8f81332

Please sign in to comment.