@@ -12,7 +12,7 @@ import XCTest
12
12
/*
13
13
* Regression tests for protection against change in generated release notes markdown content.
14
14
*/
15
- class ReleaseNotesBuilderTests : XCTestCase {
15
+ class ReleaseNotesBuilderTests : CLITestCase {
16
16
/* Reusable feature strings */
17
17
18
18
// New feature 1
@@ -195,10 +195,9 @@ class ReleaseNotesBuilderTests: XCTestCase {
195
195
196
196
private func setUpBuildRequestAndMappingJSONs( _ buildRequest: String , _ mapping: String ) {
197
197
// In real scenario, the JSON files we need are located one level above, in the workspace directory.
198
- // For tests, due to sandboxing, the dummy files are created in current directory instead of
199
- // in parent directory.
200
- FileManager . default. createFile ( atPath: " build-request.json " , contents: Data ( buildRequest. utf8) )
201
- FileManager . default. createFile ( atPath: " feature-service-id.json " , contents: Data ( mapping. utf8) )
198
+ // So, the dummy files are created in the parent of the current directory to match a real build.
199
+ FileManager . default. createFile ( atPath: " ../build-request.json " , contents: Data ( buildRequest. utf8) )
200
+ FileManager . default. createFile ( atPath: " ../feature-service-id.json " , contents: Data ( mapping. utf8) )
202
201
}
203
202
204
203
private func setUpBuilder( testCommits: [ String ] = [ ] ) throws -> ReleaseNotesBuilder {
@@ -208,11 +207,9 @@ class ReleaseNotesBuilderTests: XCTestCase {
208
207
repoOrg: . awslabs,
209
208
repoType: . awsSdkSwift,
210
209
commits: testCommits,
211
- // Parametrize behavior of FeaturesReader with paths used to create JSON test files
212
- featuresReader: FeaturesReader (
213
- requestFilePath: " build-request.json " ,
214
- mappingFilePath: " feature-service-id.json "
215
- )
210
+ // Parameterize behavior of FeaturesReader with paths used to create JSON test files
211
+ features: FeaturesReader ( ) . getFeaturesFromFile ( ) ,
212
+ featuresIDToServiceName: FeaturesReader ( ) . getFeaturesIDToServiceNameDictFromFile ( )
216
213
)
217
214
}
218
215
}
0 commit comments