-
Notifications
You must be signed in to change notification settings - Fork 0
[#741, 742] App target의 Firebase plist 경로를 단일 파일로 유지하고 앱 환경 판별과 Firebase 설정 누락 처리를 분리한다 #748
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
Application/Infra/Tests/Common/FirebaseConfigurationTests.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| // | ||
| // FirebaseConfigurationTests.swift | ||
| // InfraTests | ||
| // | ||
| // Created by opfic on 7/20/26. | ||
| // | ||
|
|
||
| import Foundation | ||
| import Testing | ||
| @testable import Infra | ||
|
|
||
| struct FirebaseConfigurationTests { | ||
| @Test("환경 변수의 database ID를 우선 사용한다") | ||
| func 환경_변수의_database_ID를_우선_사용한다() throws { | ||
| let databaseID = try FirebaseConfiguration.resolveDatabaseID( | ||
| environmentValue: "prod", | ||
| bundleValue: "staging" | ||
| ) | ||
|
|
||
| #expect(databaseID == "prod") | ||
| } | ||
|
|
||
| @Test("환경 변수의 database ID가 비어 있으면 bundle 값을 사용한다") | ||
| func 환경_변수의_database_ID가_비어_있으면_bundle_값을_사용한다() throws { | ||
| let databaseID = try FirebaseConfiguration.resolveDatabaseID( | ||
| environmentValue: " ", | ||
| bundleValue: "prod" | ||
| ) | ||
|
|
||
| #expect(databaseID == "prod") | ||
| } | ||
|
|
||
| @Test("database ID가 누락되면 오류를 반환한다") | ||
| func database_ID가_누락되면_오류를_반환한다() { | ||
| #expect( | ||
| throws: FirebaseConfigurationError.unresolvedValue("FIRESTORE_DATABASE_ID") | ||
| ) { | ||
| try FirebaseConfiguration.resolveDatabaseID( | ||
| environmentValue: nil, | ||
| bundleValue: nil | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Test("database ID가 미치환 값이면 오류를 반환한다") | ||
| func database_ID가_미치환_값이면_오류를_반환한다() { | ||
| #expect( | ||
| throws: FirebaseConfigurationError.unresolvedValue("FIRESTORE_DATABASE_ID") | ||
| ) { | ||
| try FirebaseConfiguration.resolveDatabaseID( | ||
| environmentValue: nil, | ||
| bundleValue: "$(FIRESTORE_DATABASE_ID)" | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Test("절대 HTTPS Functions URL을 반환한다") | ||
| func 절대_HTTPS_Functions_URL을_반환한다() throws { | ||
| let url = try FirebaseConfiguration.resolveFunctionAPIBaseURL( | ||
| environmentValue: nil, | ||
| bundleValue: "https://example.com/stagingApi/api" | ||
| ) | ||
|
|
||
| #expect(url == URL(string: "https://example.com/stagingApi/api")) | ||
| } | ||
|
|
||
| @Test("Functions URL이 누락되면 bad URL 오류를 반환한다") | ||
| func Functions_URL이_누락되면_bad_URL_오류를_반환한다() { | ||
| #expect(throws: URLError.self) { | ||
| try FirebaseConfiguration.resolveFunctionAPIBaseURL( | ||
| environmentValue: nil, | ||
| bundleValue: nil | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Test("Functions URL이 상대 경로이면 bad URL 오류를 반환한다") | ||
| func Functions_URL이_상대_경로이면_bad_URL_오류를_반환한다() { | ||
| #expect(throws: URLError.self) { | ||
| try FirebaseConfiguration.resolveFunctionAPIBaseURL( | ||
| environmentValue: nil, | ||
| bundleValue: "stagingApi/api" | ||
| ) | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.