Skip to content

Commit

Permalink
fix failing workflow unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OS-ricardomoreirasilva committed Jan 30, 2025
1 parent 1d8421b commit 8422aed
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,18 @@ jobs:
run: bundle install

- name: Unit tests
env:
FASTLANE_VERBOSE: "true"
run: bundle exec fastlane unit_tests

- name: Upload test results
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
fastlane/test_output
test-results
- name: Code Coverage
run: bundle exec fastlane coverage
Expand Down
4 changes: 0 additions & 4 deletions IONFilesystemLib.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
751328DB2D318E770031BDD0 /* MockFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 751328D82D3179430031BDD0 /* MockFileManager.swift */; };
7575CF6A2BFCEE6F008F3FD0 /* IONFilesystemLib.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7575CF612BFCEE6F008F3FD0 /* IONFilesystemLib.framework */; };
75DA44542D48E435006DF7DE /* IONFILEChunkPublisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75DA44532D48E435006DF7DE /* IONFILEChunkPublisher.swift */; };
75DA445A2D490051006DF7DE /* file_emojiContent.txt in Resources */ = {isa = PBXBuildFile; fileRef = 75DA44592D490051006DF7DE /* file_emojiContent.txt */; };
75F8380B2D37E42000FCE044 /* IONFILEItemAttributeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75F8380A2D37E42000FCE044 /* IONFILEItemAttributeModel.swift */; };
75F84D662D39360E00892C89 /* IONFILEManager+Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75F84D652D39360E00892C89 /* IONFILEManager+Errors.swift */; };
75F84D682D39362F00892C89 /* IONFILEManager+Enums.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75F84D672D39362F00892C89 /* IONFILEManager+Enums.swift */; };
Expand Down Expand Up @@ -40,7 +39,6 @@
7575CF612BFCEE6F008F3FD0 /* IONFilesystemLib.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = IONFilesystemLib.framework; sourceTree = BUILT_PRODUCTS_DIR; };
7575CF692BFCEE6F008F3FD0 /* IONFilesystemLibTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = IONFilesystemLibTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
75DA44532D48E435006DF7DE /* IONFILEChunkPublisher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IONFILEChunkPublisher.swift; sourceTree = "<group>"; };
75DA44592D490051006DF7DE /* file_emojiContent.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = file_emojiContent.txt; sourceTree = "<group>"; };
75F8380A2D37E42000FCE044 /* IONFILEItemAttributeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IONFILEItemAttributeModel.swift; sourceTree = "<group>"; };
75F84D652D39360E00892C89 /* IONFILEManager+Errors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "IONFILEManager+Errors.swift"; sourceTree = "<group>"; };
75F84D672D39362F00892C89 /* IONFILEManager+Enums.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "IONFILEManager+Enums.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -109,7 +107,6 @@
751328D92D318DBA0031BDD0 /* IONFILEDirectoryManagerTests.swift */,
75FEB2B32D35479B007C2686 /* IONFILEFileManagerTests.swift */,
75FEB2B62D355F21007C2686 /* file.txt */,
75DA44592D490051006DF7DE /* file_emojiContent.txt */,
);
path = IONFilesystemLibTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -218,7 +215,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
75DA445A2D490051006DF7DE /* file_emojiContent.txt in Resources */,
75FEB2B72D355F21007C2686 /* file.txt in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
14 changes: 0 additions & 14 deletions IONFilesystemLibTests/IONFILEFileManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,6 @@ extension IONFILEFileManagerTests {
XCTAssertEqual($0 as? IONFILEChunkPublisherError, .notAbleToReadFile)
}
}

func test_readFileInChunks_withInvalidContent_returnsError() {
// Given
createFileManager()

// When
XCTAssertThrowsError(try fetchChunkedContent(
forFile: (Configuration.fileWithEmojiName, Configuration.fileExtension), withEncoding: .string(encoding: .ascii)
)) {
// Then
XCTAssertEqual($0 as? IONFILEChunkPublisherError, .cantEncodeData)
}
}
}

// MARK: - 'getFileURL' tests
Expand Down Expand Up @@ -759,7 +746,6 @@ extension IONFILEFileManagerTests {
private extension IONFILEFileManagerTests {
struct Configuration {
static let fileName = "file"
static let fileWithEmojiName = "file_emojiContent"
static let newFileName = "new_file"
static let fileExtension = "txt"
static let fileContent = "Hello, world!"
Expand Down
1 change: 0 additions & 1 deletion IONFilesystemLibTests/file_emojiContent.txt

This file was deleted.

9 changes: 8 additions & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ default_platform(:ios)
platform :ios do
desc "Lane to run the unit tests"
lane :unit_tests do
run_tests(scheme: "IONFilesystemLib")
run_tests(
scheme: "IONFilesystemLib",
result_bundle: true,
output_directory: "test-results",
output_types: "html,junit",
buildlog_path: "fastlane/test_output",
include_simulator_logs: true
)
end

desc "Code coverage"
Expand Down

0 comments on commit 8422aed

Please sign in to comment.