Skip to content
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
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4.0'
xcode-version: latest

- name: Create config file
run: |
Expand Down Expand Up @@ -77,8 +77,7 @@ jobs:
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4.0'

xcode-version: '16.4.0'
- name: Create config file
run: |
echo '{
Expand All @@ -92,7 +91,7 @@ jobs:
xcodebuild test \
-workspace ContentstackSwift.xcworkspace \
-scheme "ContentstackSwift iOS Tests" \
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17.5' \
-destination "platform=iOS Simulator,name=iPhone 16,OS=18.5" \
-sdk iphonesimulator \
ONLY_ACTIVE_ARCH=NO \
CODE_SIGNING_ALLOWED=NO
29 changes: 0 additions & 29 deletions .github/workflows/secrets-scan.yml

This file was deleted.

10 changes: 9 additions & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
* @contentstack/security-admin
* @contentstack/devex-pr-reviewers

.github/workflows/sca-scan.yml @contentstack/security-admin

**/.snyk @contentstack/security-admin

.github/workflows/policy-scan.yml @contentstack/security-admin

.github/workflows/issues-jira.yml @contentstack/security-admin
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "contentstack/contentstack-swift-dvr" "c8040a2451e4bc2c312347531cac6c73f23ce50c"
github "contentstack/contentstack-swift-dvr" "v1.0.0"
github "contentstack/contentstack-utils-swift" "v1.3.4"
60 changes: 30 additions & 30 deletions Tests/AssetQueryAPITest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AssetQueryAPITest: XCTestCase {
(stack.urlSession as? DVR.Session)?.endRecording()
}

func test01FindAll_AssetQuery() {
func test01FindAll_AssetQuery() async {
let networkExpectation = expectation(description: "Fetch All Assets Test")
self.getAssetQuery().locale("en-us").find { (result: Result<ContentstackResponse<AssetModel>, Error>, response: ResponseType) in
switch result {
Expand All @@ -61,10 +61,10 @@ class AssetQueryAPITest: XCTestCase {
}
networkExpectation.fulfill()
}
wait(for: [networkExpectation], timeout: 5)
await fulfillment(of: [networkExpectation], timeout: 5)
}

func test02Find_AssetQuery_whereUIDEquals() {
func test02Find_AssetQuery_whereUIDEquals() async {
let networkExpectation = expectation(description: "Fetch where UID equals Assets Test")
self.queryWhere(.uid, operation: .equals(AssetQueryAPITest.kAssetUID)) { (result: Result<ContentstackResponse<AssetModel>, Error>) in
switch result {
Expand All @@ -77,10 +77,10 @@ class AssetQueryAPITest: XCTestCase {
}
networkExpectation.fulfill()
}
wait(for: [networkExpectation], timeout: 5)
await fulfillment(of: [networkExpectation], timeout: 5)
}

func test03Find_AssetQuery_whereTitleDNotEquals() {
func test03Find_AssetQuery_whereTitleDNotEquals() async {
let networkExpectation = expectation(description: "Fetch where Title equals Assets Test")
self.queryWhere(.title, operation: .notEquals(AssetQueryAPITest.kAssetTitle)) { (result: Result<ContentstackResponse<AssetModel>, Error>) in
switch result {
Expand All @@ -93,10 +93,10 @@ class AssetQueryAPITest: XCTestCase {
}
networkExpectation.fulfill()
}
wait(for: [networkExpectation], timeout: 5)
await fulfillment(of: [networkExpectation], timeout: 5)
}

func test03Find_AssetQuery_whereFileNameEquals() {
func test03Find_AssetQuery_whereFileNameEquals() async {
let networkExpectation = expectation(description: "Fetch where Title equals Assets Test")
self.queryWhere(.fileName, operation: .notEquals(AssetQueryAPITest.kFileName)) { (result: Result<ContentstackResponse<AssetModel>, Error>) in
switch result {
Expand All @@ -109,10 +109,10 @@ class AssetQueryAPITest: XCTestCase {
}
networkExpectation.fulfill()
}
wait(for: [networkExpectation], timeout: 5)
await fulfillment(of: [networkExpectation], timeout: 5)
}

func test04Find_AssetQuery_whereFileNameexists() {
func test04Find_AssetQuery_whereFileNameexists() async {
let networkExpectation = expectation(description: "Fetch where fileName exists Assets Test")
self.queryWhere(.fileName, operation: .exists(true)) { (result: Result<ContentstackResponse<AssetModel>, Error>) in
switch result {
Expand All @@ -123,10 +123,10 @@ class AssetQueryAPITest: XCTestCase {
}
networkExpectation.fulfill()
}
wait(for: [networkExpectation], timeout: 5)
await fulfillment(of: [networkExpectation], timeout: 5)
}

func test05Find_AssetQuery_whereTitleMatchRegex() {
func test05Find_AssetQuery_whereTitleMatchRegex() async {
let networkExpectation = expectation(description: "Fetch where Title Match Regex Assets Test")
self.queryWhere(.title, operation: .matches("im")) { (result: Result<ContentstackResponse<AssetModel>, Error>) in
switch result {
Expand All @@ -137,10 +137,10 @@ class AssetQueryAPITest: XCTestCase {
}
networkExpectation.fulfill()
}
wait(for: [networkExpectation], timeout: 5)
await fulfillment(of: [networkExpectation], timeout: 5)
}

func test06Fetch_Asset_fromUID() {
func test06Fetch_Asset_fromUID() async {
let networkExpectation = expectation(description: "Fetch Assets from UID Test")
self.getAsset(uid: AssetQueryAPITest.kAssetUID).fetch { (result: Result<AssetModel, Error>, response: ResponseType) in
switch result {
Expand All @@ -151,10 +151,10 @@ class AssetQueryAPITest: XCTestCase {
}
networkExpectation.fulfill()
}
wait(for: [networkExpectation], timeout: 5)
await fulfillment(of: [networkExpectation], timeout: 5)
}

func test07Fetch_AssetQuery_WithDimentsions() {
func test07Fetch_AssetQuery_WithDimentsions() async {
let networkExpectation = expectation(description: "Fetch Assets with GLobalFields Test")
self.getAssetQuery()
.include(params: .dimension)
Expand All @@ -169,11 +169,11 @@ class AssetQueryAPITest: XCTestCase {
}
networkExpectation.fulfill()
}
wait(for: [networkExpectation], timeout: 5)
await fulfillment(of: [networkExpectation], timeout: 5)

}

func test08Fetch_Asset_WithGlobalFields() {
func test08Fetch_Asset_WithGlobalFields() async {
let networkExpectation = expectation(description: "Fetch Assets with GlobalFields Test")
self.getAsset(uid: AssetQueryAPITest.kAssetUID)
.includeDimension()
Expand All @@ -186,10 +186,10 @@ class AssetQueryAPITest: XCTestCase {
}
networkExpectation.fulfill()
}
wait(for: [networkExpectation], timeout: 5)
await fulfillment(of: [networkExpectation], timeout: 5)
}

func test09Fetch_AssetQuery_WithCount() {
func test09Fetch_AssetQuery_WithCount() async {
let networkExpectation = expectation(description: "Fetch Assets with Count Test")
self.getAssetQuery()
.locale("en-us")
Expand All @@ -203,11 +203,11 @@ class AssetQueryAPITest: XCTestCase {
}
networkExpectation.fulfill()
}
wait(for: [networkExpectation], timeout: 5)
await fulfillment(of: [networkExpectation], timeout: 5)

}

func test11Fetch_Asset_WithWrongUID_shouldFail() {
func test11Fetch_Asset_WithWrongUID_shouldFail() async {
let networkExpectation = expectation(description: "Fetch Assets from wrong UID Test")
self.getAsset(uid: "UID").fetch { (result: Result<AssetModel, Error>, response: ResponseType) in
switch result {
Expand All @@ -221,10 +221,10 @@ class AssetQueryAPITest: XCTestCase {
}
networkExpectation.fulfill()
}
wait(for: [networkExpectation], timeout: 5)
await fulfillment(of: [networkExpectation], timeout: 5)
}

func test12Fetch_AssetQuery_WithoutFallback_Result() {
func test12Fetch_AssetQuery_WithoutFallback_Result() async {
let networkExpectation = expectation(description: "Fetch Assets without Fallback Test")
self.getAssetQuery().locale(AssetQueryAPITest.locale)
.find { (result: Result<ContentstackResponse<AssetModel>, Error>, response: ResponseType) in
Expand All @@ -242,10 +242,10 @@ class AssetQueryAPITest: XCTestCase {
}
networkExpectation.fulfill()
}
wait(for: [networkExpectation], timeout: 5)
await fulfillment(of: [networkExpectation], timeout: 5)
}

func test13Fetch_AssetQuery_Fallback_Result() {
func test13Fetch_AssetQuery_Fallback_Result() async {
let networkExpectation = expectation(description: "Fetch Assets without Fallback Test")
self.getAssetQuery()
.locale(AssetQueryAPITest.locale)
Expand Down Expand Up @@ -275,10 +275,10 @@ class AssetQueryAPITest: XCTestCase {
}
networkExpectation.fulfill()
}
wait(for: [networkExpectation], timeout: 5)
await fulfillment(of: [networkExpectation], timeout: 5)
}

func test14Fetch_Asset_UIDWithoutFallback_NoResult() {
func test14Fetch_Asset_UIDWithoutFallback_NoResult() async {
let networkExpectation = expectation(description: "Fetch Asset from UID without Fallback Test")
self.getAsset(uid: AssetQueryAPITest.kAssetLocaliseUID)
.locale("en-gb")
Expand All @@ -294,10 +294,10 @@ class AssetQueryAPITest: XCTestCase {
}
networkExpectation.fulfill()
}
wait(for: [networkExpectation], timeout: 5)
await fulfillment(of: [networkExpectation], timeout: 5)
}

func test15Fetch_Asset_UIDWithFallback_NoResult() {
func test15Fetch_Asset_UIDWithFallback_NoResult() async {
let networkExpectation = expectation(description: "Fetch Asset from UID without Fallback Test")
self.getAsset(uid: AssetQueryAPITest.kAssetLocaliseUID)
.locale(AssetQueryAPITest.locale)
Expand All @@ -315,6 +315,6 @@ class AssetQueryAPITest: XCTestCase {
}
networkExpectation.fulfill()
}
wait(for: [networkExpectation], timeout: 5)
await fulfillment(of: [networkExpectation], timeout: 5)
}
}
Loading
Loading