Skip to content

Commit 0b9e6eb

Browse files
committed
Merge branch 'develop'
2 parents 8033b8a + 6dda4cd commit 0b9e6eb

File tree

126 files changed

+721
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+721
-112
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
UI-TESTS/BUILDS/iOS/*/** filter=lfs diff=lfs merge=lfs -text
2+
.app filter=lfs diff=lfs merge=lfs -text
3+
UnityFramework filter=lfs diff=lfs merge=lfs -text
4+
UI-TESTS/BUILDS/iOS/ConsentMessagePlugin.app/*/** filter=lfs diff=lfs merge=lfs -text
5+
UI-TESTS/BUILDS/iOS/ConsentMessagePlugin.app filter=lfs diff=lfs merge=lfs -text

.github/workflows/Test.yml

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
name: UI tests
2+
on: [pull_request]
3+
4+
jobs:
5+
AndroidUITests:
6+
needs: IOSUITests
7+
if: always()
8+
runs-on: ubuntu-latest
9+
name: AndroidUITests
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
- name: Enable KVM
14+
run: |
15+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
16+
sudo udevadm control --reload-rules
17+
sudo udevadm trigger --name-match=kvm
18+
- name: set up JDK 17
19+
uses: actions/setup-java@v4
20+
with:
21+
distribution: zulu
22+
java-version: 17
23+
- name: Gradle cache
24+
uses: gradle/actions/setup-gradle@v3
25+
- name: AVD cache
26+
uses: actions/cache@v4
27+
id: avd-cache
28+
with:
29+
path: |
30+
~/.android/avd/*
31+
~/.android/adb*
32+
key: avd-34
33+
- name: create AVD and generate snapshot for caching
34+
if: steps.avd-cache.outputs.cache-hit != 'true'
35+
uses: reactivecircus/android-emulator-runner@v2
36+
with:
37+
api-level: 34
38+
target: google_apis
39+
force-avd-creation: true
40+
disk-size: 6000M
41+
heap-size: 3048M
42+
ram-size: 3048M
43+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
44+
disable-animations: false
45+
arch: x86_64
46+
script: echo "Generated AVD snapshot for caching."
47+
- name: Setup .NET
48+
uses: actions/setup-dotnet@v1
49+
with:
50+
dotnet-version: '8.0'
51+
- name: Setup dotnet-test-rerun
52+
run: |
53+
dotnet tool install --global dotnet-test-rerun
54+
- name: Install and run Appium Server
55+
run: |
56+
npm i --location=global appium
57+
appium driver install uiautomator2
58+
CurWorkDir=$(pwd)
59+
pushd "$CurWorkDir"
60+
mkdir logs
61+
cd logs
62+
echo "appium" > appiumLog.txt
63+
popd
64+
appium &>logs/appiumLog.txt &
65+
- name: Create log files for logcat
66+
run: |
67+
cd logs
68+
echo "logcat" > logcat.txt
69+
echo "logcat" > logcatPID.txt
70+
- name: Install and run AltTester Server
71+
run: |
72+
CurWorkDir=$(pwd)
73+
pushd "$CurWorkDir"
74+
cd logs
75+
echo "alttester" > altTesterLog.txt
76+
echo "alttester" > runAltTesterLog.txt
77+
popd
78+
wget https://alttester.com/app/uploads/AltTester/desktop/AltTesterDesktopLinuxBatchmode.zip
79+
unzip AltTesterDesktopLinuxBatchmode.zip
80+
cd AltTesterDesktopLinux
81+
chmod +x AltTesterDesktop.x86_64
82+
./AltTesterDesktop.x86_64 -batchmode -nographics -port 13000 -license ${{ secrets.ALTTESTERLICENSEKEY }} -termsAndConditionsAccepted -logfile ~/work/unity-sdk/unity-sdk/logs/altTesterLog.txt &>~/work/unity-sdk/unity-sdk/logs/runAltTesterLog.txt &
83+
- name: Start emulator and run tests
84+
uses: reactivecircus/android-emulator-runner@v2
85+
with:
86+
api-level: 34
87+
target: google_apis
88+
force-avd-creation: false
89+
disk-size: 6000M
90+
heap-size: 3048M
91+
ram-size: 3048M
92+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
93+
disable-animations: true
94+
arch: x86_64
95+
script: |
96+
adb logcat > ~/work/unity-sdk/unity-sdk/logs/logcat.txt & echo $! > ~/work/unity-sdk/unity-sdk/logs/logcatPID.txt
97+
cd ~/work/unity-sdk/unity-sdk && chmod -R 777 UI-TESTS
98+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/android.runsettings --filter Name=ClickAcceptAllButtonTest --rerunMaxAttempts 5
99+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/android.runsettings --filter Name=ClickRejectAllButtonTest --rerunMaxAttempts 5
100+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/android.runsettings --filter Name=OpenPmLayersTest --rerunMaxAttempts 5
101+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/android.runsettings --filter Name=SaveAndExitGDPRTest --rerunMaxAttempts 5
102+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/android.runsettings --filter Name=SaveAndExitCCPATest --rerunMaxAttempts 5
103+
# :test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/android.runsettings --filter Name=SaveAndExitUSNATTest --rerunMaxAttempts 5
104+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/android.runsettings --filter Name=ClearAllButtonTest --rerunMaxAttempts 5
105+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/android.runsettings --filter Name=AuthIdTest --rerunMaxAttempts 5
106+
# :test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/android.runsettings --filter Name=AcceptRejectAllUsnatInPMTest --rerunMaxAttempts 5
107+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/android.runsettings --filter Name=ProgramaticRejectAllGDPRTest --rerunMaxAttempts 5
108+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/android.runsettings --filter Name=ProgramaticRejectAllCCPATest --rerunMaxAttempts 5
109+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/android.runsettings --filter Name=ProgramaticRejectAllUSNATTest --rerunMaxAttempts 5
110+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/android.runsettings --filter Name=ProgramaticCustomConsentGDPRTest --rerunMaxAttempts 5
111+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/android.runsettings --filter Name=MessageLanguageTest --rerunMaxAttempts 5
112+
lsof -P | cat ~/work/unity-sdk/unity-sdk/logs/logcatPID.txt | xargs kill
113+
- name: Move dotnet logs
114+
if: always()
115+
run: |
116+
cd ~/work/unity-sdk/unity-sdk/UI-TESTS
117+
find . -name '*.trx' -exec mv {} ~/work/unity-sdk/unity-sdk/logs \;
118+
- name: Archive logs
119+
if: always()
120+
uses: actions/upload-artifact@v4
121+
with:
122+
name: androidLogs
123+
path: logs/
124+
compression-level: 0
125+
IOSUITests:
126+
runs-on: macos-13
127+
name: IOSUITests
128+
steps:
129+
- name: Checkout
130+
uses: actions/checkout@v4
131+
with:
132+
lfs: 'true'
133+
- name: Checkout LFS objects
134+
run: git lfs pull
135+
- name: Setup XCode
136+
run: sudo xcode-select -s '/Applications/Xcode_14.1.app/Contents/Developer'
137+
- name: Boot simulator
138+
run: |
139+
xcrun simctl boot $(xcrun simctl list devices | grep -m 1 'iPhone 14' |grep -E -o -i '([0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})')
140+
sleep 30
141+
open -a simulator
142+
sleep 60
143+
xcrun simctl list devices
144+
- name: Setup .NET
145+
uses: actions/setup-dotnet@v1
146+
with:
147+
dotnet-version: '8.0'
148+
- name: Setup dotnet-test-rerun
149+
run: |
150+
dotnet tool install --global dotnet-test-rerun
151+
- name: Install and run Appium Server
152+
run: |
153+
npm i --location=global appium
154+
appium driver install xcuitest
155+
CurWorkDir=$(pwd)
156+
pushd "$CurWorkDir"
157+
mkdir logs
158+
cd logs
159+
echo "appium" > appiumLog.txt
160+
popd
161+
appium &>logs/appiumLog.txt &
162+
- name: Install and run AltTester Server
163+
run: |
164+
CurWorkDir=$(pwd)
165+
pushd "$CurWorkDir"
166+
cd logs
167+
echo "alttester" > altTesterLog.txt
168+
echo "alttester" > runAltTesterLog.txt
169+
popd
170+
wget https://alttester.com/app/uploads/AltTester/desktop/AltTesterDesktopPackageMac__v2.1.2.zip
171+
unzip AltTesterDesktopPackageMac__v2.1.2.zip
172+
cd AltTesterDesktopPackageMac__v2.1.2
173+
hdiutil attach AltTesterDesktop__v2.1.2.dmg
174+
cp -R /Volumes/AltTesterDesktop/AltTesterDesktop.app ~
175+
cd ~ && AltTesterDesktop.app/Contents/MacOS/AltTesterDesktop -batchmode -nographics -port 13000 -license ${{ secrets.ALTTESTERLICENSEKEY }} -termsAndConditionsAccepted -logfile ~/work/unity-sdk/unity-sdk/logs/altTesterLog.txt &>~/work/unity-sdk/unity-sdk/logs/runAltTesterLog.txt &
176+
- name: Run tests
177+
run: |
178+
cd ~/work/unity-sdk/unity-sdk && chmod -R 777 UI-TESTS
179+
cd UI-TESTS
180+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/ios.runsettings --filter Name=ClickAcceptAllButtonTest --rerunMaxAttempts 5
181+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/ios.runsettings --filter Name=ClickRejectAllButtonTest --rerunMaxAttempts 5
182+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/ios.runsettings --filter Name=OpenPmLayersTest --rerunMaxAttempts 5
183+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/ios.runsettings --filter Name=SaveAndExitGDPRTest --rerunMaxAttempts 5
184+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/ios.runsettings --filter Name=SaveAndExitCCPATest --rerunMaxAttempts 5
185+
# :test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/ios.runsettings --filter Name=SaveAndExitUSNATTest --rerunMaxAttempts 5
186+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/ios.runsettings --filter Name=ClearAllButtonTest --rerunMaxAttempts 5
187+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/ios.runsettings --filter Name=AuthIdTest --rerunMaxAttempts 5
188+
# :test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/ios.runsettings --filter Name=AcceptRejectAllUsnatInPMTest --rerunMaxAttempts 5
189+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/ios.runsettings --filter Name=ProgramaticRejectAllGDPRTest --rerunMaxAttempts 5
190+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/ios.runsettings --filter Name=ProgramaticRejectAllCCPATest --rerunMaxAttempts 5
191+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/ios.runsettings --filter Name=ProgramaticRejectAllUSNATTest --rerunMaxAttempts 5
192+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/ios.runsettings --filter Name=ProgramaticCustomConsentGDPRTest --rerunMaxAttempts 5
193+
test-rerun ~/work/unity-sdk/unity-sdk/UI-TESTS -s ~/work/unity-sdk/unity-sdk/UI-TESTS/ios.runsettings --filter Name=MessageLanguageTest --rerunMaxAttempts 5
194+
- name: Move dotnet logs
195+
if: always()
196+
run: |
197+
cd ~/work/unity-sdk/unity-sdk/UI-TESTS
198+
find . -name '*.trx' -exec mv {} ~/work/unity-sdk/unity-sdk/logs \;
199+
- name: Archive logs
200+
if: always()
201+
uses: actions/upload-artifact@v4
202+
with:
203+
name: iosLogs
204+
path: logs/
205+
compression-level: 0

.github/workflows/activation.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Acquire activation file
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
activation:
8+
name: Request manual activation file 🔑
9+
runs-on: macos-latest
10+
steps:
11+
# Request manual activation file
12+
- name: Unity - Request Activation File
13+
id: requestActivationFile
14+
uses: game-ci/unity-request-activation-file@v2.0-alpha-1
15+
- name: Upload activation file
16+
uses: actions/upload-artifact@v3
17+
with:
18+
name: ${{ steps.requestActivationFile.outputs.filePath }}
19+
path: ${{ steps.requestActivationFile.outputs.filePath }}
20+
retention-days: 3

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
.gradle/
1818

1919
# Builds
20-
*.apk
20+
*DoNotShip*
2121

2222
# Autogenerated VS/MD/Consulo solution and project files
2323
ExportedObj/
@@ -60,8 +60,8 @@ Thumbs.db.meta
6060
#UI-TESTS related
6161
/UI-TESTS/bin/Debug/
6262
/UI-TESTS/obj/Debug/
63-
/UI-TESTS/BUILDS/Android/
64-
/UI-TESTS/BUILDS/iOS/
63+
/UI-TESTS/BUILDS/IOS/*
64+
!/UI-TESTS/BUILDS/IOS/ConsentMessagePlugin.app
6565
/UI-TESTS/obj/project.nuget.cache
6666
/UI-TESTS/obj/
6767
!/UI-TESTS/UI-TESTS.csproj

Assets/ConsentManagementProvider/Editor/CMPPostProcessBuild.cs

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
using UnityEditor;
33
using UnityEditor.Callbacks;
44
using UnityEditor.iOS.Xcode;
5+
using System;
6+
using System.Diagnostics;
57
using System.IO;
68
using UnityEditor.iOS.Xcode.Extensions;
79
using UnityEngine;
@@ -31,10 +33,12 @@ public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath)
3133
EnableBitcode(pbxProject, unityProjectGuid, false);
3234

3335
string bridgePath="Libraries/ConsentManagementProvider/Plugins/iOS/Source/SwiftBridge.swift";
36+
string newBridgePath="Pods/ConsentViewController/ConsentViewController/Classes/SwiftBridge.swift";
3437
RemoveBridge(pbxProject,bridgePath);
38+
ExecuteProcessTerminal("mv "+buildPath+"/"+bridgePath+" "+buildPath+"/"+newBridgePath);
3539
pbxProject.WriteToFile(projPath);
3640

37-
AddBridgeToPods(buildPath, bridgePath);
41+
AddBridgeToPods(buildPath, newBridgePath);
3842

3943
string plistPath = buildPath + "/Info.plist";
4044
AddParameterToInfoPlist(plistPath);
@@ -120,5 +124,34 @@ static void EnableSwift(PBXProject pbxProject, string targetGuid)
120124
pbxProject.AddBuildProperty(targetGuid, "COREML_CODEGEN_LANGUAGE", "Swift");
121125
pbxProject.AddBuildProperty(targetGuid, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES");
122126
}
127+
128+
private static void ExecuteProcessTerminal(string argument)
129+
{
130+
try
131+
{
132+
UnityEngine.Debug.Log("============== Start Executing [" + argument + "] ===============");
133+
ProcessStartInfo startInfo = new ProcessStartInfo()
134+
{
135+
FileName = "/bin/bash",
136+
UseShellExecute = false,
137+
RedirectStandardError = true,
138+
RedirectStandardInput = true,
139+
RedirectStandardOutput = true,
140+
CreateNoWindow = true,
141+
Arguments = " -c \"" + argument + " \""
142+
};
143+
Process myProcess = new Process
144+
{
145+
StartInfo = startInfo
146+
};
147+
myProcess.Start();
148+
myProcess.WaitForExit();
149+
UnityEngine.Debug.Log("============== End ===============");
150+
}
151+
catch (Exception e)
152+
{
153+
UnityEngine.Debug.Log("Excetion on CMPPostProcessBuild");
154+
}
155+
}
123156
}
124157
#endif
53.5 MB
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:d2159a2299ccbaabedd1c5f54ce6628b9fb4864270ef21bf2759942a03939cd6
3+
size 29752
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)