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

chore(app): ci fix #865

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 17 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ jobs:
echo '127.0.0.1 api-gateway.trustbloc.local' | sudo tee -a /etc/hosts
echo '127.0.0.1 cognito-mock.trustbloc.local' | sudo tee -a /etc/hosts
- name: Install and start docker
uses: douglascamata/setup-docker-macos-action@8d5fa43892aed7eee4effcdea113fd53e4d4bf83
uses: douglascamata/setup-docker-macos-action@v1-alpha
with:
upgrade-qemu: false
lima: v0.22.0
colima: v0.7.3
lima: v1.0.4
colima: v0.8.1
- name: Download artifacts (Docker images) from previous workflows
uses: actions/download-artifact@v4
- name: Load mock-login-consent server
Expand All @@ -240,19 +240,25 @@ jobs:
uses: flutter-actions/setup-flutter@v2
with:
channel: stable
version: 3.19.5
version: 3.27.4
- name: Install flutter app dependencies
run: make install-flutter-dependencies
- name: Run iOS Simulator
uses: futureware-tech/simulator-action@v3
with:
model: 'iPhone 14'
model: 'iPhone 15'
- name: Remove AppIcon contents file (Simulator build fails with this file)
run: |
rm -rf demo/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
rm -rf demo/app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
- name: Run tests on Simulator
run: make integration-test-flutter integration-test-ios
- name: Debug Path
run: ls -lah $GITHUB_WORKSPACE/demo/app/integration_test/
- name: Fix file permissions
run: chmod +r $GITHUB_WORKSPACE/demo/app/integration_test/openid4ci_test.dart
- name: Run flutter tests on Simulator
run: make integration-test-flutter
- name: Run ios tests on Simulator
run: make integration-test-ios
- name: Docker container status output
if: always()
run: |
Expand Down Expand Up @@ -292,11 +298,11 @@ jobs:
echo '127.0.0.1 api-gateway.trustbloc.local' | sudo tee -a /etc/hosts
echo '127.0.0.1 cognito-mock.trustbloc.local' | sudo tee -a /etc/hosts
- name: Install and start docker
uses: douglascamata/setup-docker-macos-action@8d5fa43892aed7eee4effcdea113fd53e4d4bf83
uses: douglascamata/setup-docker-macos-action@v1-alpha
with:
upgrade-qemu: false
lima: v0.22.0
colima: v0.7.3
lima: v1.0.4
colima: v0.8.1
- name: Download artifacts (Docker images) from previous workflows
uses: actions/download-artifact@v4
- name: Load mock-login-consent server
Expand Down Expand Up @@ -327,7 +333,7 @@ jobs:
uses: flutter-actions/setup-flutter@v2
with:
channel: stable
version: 3.19.5
version: 3.27.4
- name: Install flutter app dependencies
run: make install-flutter-dependencies
- name: Build APK in Debug mode
Expand Down
66 changes: 40 additions & 26 deletions demo/app/integration_test/openid4ci_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,37 +61,49 @@ void main() async {
}
}''',);

final credentials = (await walletSDKPlugin.requestCredential('', attestationVC: attestationVC)).map((e) => e.content).toList();

expect(credentials, hasLength(greaterThan(0)));

String verificationURL = verificationURLsList[i];
print('verificationURL : $verificationURL');

await walletSDKPlugin.processAuthorizationRequest(authorizationRequest: verificationURL);

final requirements = await walletSDKPlugin.getSubmissionRequirements(storedCredentials: credentials);

print('getSubmissionRequirements finished');

expect(requirements, hasLength(equals(1)));
expect(requirements[0].inputDescriptors, hasLength(equals(1)));
expect(requirements[0].inputDescriptors[0].matchedVCsID, hasLength(equals(1)));
var customScopesList = {
'registration': jsonEncode({'email': '[email protected]'}),
};

await walletSDKPlugin.presentCredential(
selectedCredentials: credentials, customScopeList: customScopesList, attestationVC: attestationVC);
List<String> credentials;
await tester.runAsync(() async {
credentials = (await walletSDKPlugin.requestCredential('', attestationVC: attestationVC))
.map((e) => e.content)
.toList();
print('credentials');
expect(credentials, hasLength(greaterThan(0)));

String verificationURL = verificationURLsList[i];
print('verificationURL : $verificationURL');

final l = await walletSDKPlugin.processAuthorizationRequest(authorizationRequest: verificationURL);
print('processAuthorizationRequest --> : $l');

// Add another delay if needed
await Future.delayed(Duration(seconds: 2));

final requirements = await walletSDKPlugin.getSubmissionRequirements(storedCredentials: credentials);
print('getSubmissionRequirements finished');

expect(requirements, hasLength(equals(1)));
expect(requirements[0].inputDescriptors, hasLength(equals(1)));
expect(requirements[0].inputDescriptors[0].matchedVCsID, hasLength(equals(1)));

var customScopesList = {
'registration': jsonEncode({'email': '[email protected]'}),
};
await walletSDKPlugin.presentCredential(
selectedCredentials: credentials, customScopeList: customScopesList, attestationVC: attestationVC);
print('credential presented');
});
}
});
},
timeout: Timeout.none );

testWidgets('Testing openid4vc with multiple credentials', (tester) async {
const didMethodTypes = String.fromEnvironment('WALLET_DID_METHODS');
var didMethodTypesList = didMethodTypes.split(' ');
String didMethodType = didMethodTypesList[0];
print('wallet DID type : $didMethodType');
print('wallet DID Key type : $didKeyType');

await Future.delayed(Duration(seconds: 2));
var didDocData = await walletSDKPlugin.createDID(didMethodTypesList[0], didKeyType);
var didContent = didDocData.did;
print('wallet DID : $didContent');
Expand All @@ -118,7 +130,7 @@ void main() async {

credentials.addAll(requestdCreds.map((e) => e.content).toList());
}
print('issued credentials: $credentials');
print('issued credentials');

const verificationURLs = String.fromEnvironment('INITIATE_VERIFICATION_URLS_MULTIPLE_CREDS');
var verificationURLsList = verificationURLs.split(' ');
Expand All @@ -140,8 +152,10 @@ void main() async {
'testscope': jsonEncode({'data': 'testdata'}),
};

// Add a delay before presenting credentials
await Future.delayed(Duration(seconds: 2));
await walletSDKPlugin.presentCredential(selectedCredentials: matchedCreds, customScopeList: customScopesList);
});
}, timeout: Timeout.none );

testWidgets('Testing openid4vc with the auth code flow', (tester) async {
const didMethodTypes = String.fromEnvironment('WALLET_DID_METHODS');
Expand Down Expand Up @@ -204,5 +218,5 @@ void main() async {
}

expect(credential, hasLength(greaterThan(0)));
});
}, timeout: Timeout.none );
}
Loading
Loading