Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[CI] Run unit and functional tests separately in CI #368

Merged
merged 7 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
18 changes: 13 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,12 @@ jobs:
# See options explanation here: https://docs.codecov.com/docs/codecov-uploader
- codecov/upload:
flags: ios-tests
upload_name: Coverage Report for iOS Tests
xtra_args: -c -v --xc --xp iosresults.xcresult
upload_name: Coverage report for iOS unit tests
xtra_args: -c -v --xc --xp iosUnitResults.xcresult
- codecov/upload:
flags: ios-tests
upload_name: Coverage report for iOS functional tests
xtra_args: -c -v --xc --xp iosFunctionalResults.xcresult

test-tvos:
macos:
Expand All @@ -134,9 +138,13 @@ jobs:
# See options explanation here: https://docs.codecov.com/docs/codecov-uploader
- codecov/upload:
flags: tvos-tests
upload_name: Coverage Report for tvOS Tests
xtra_args: -c -v --xc --xp tvosresults.xcresult

upload_name: Coverage report for tvOS unit tests
xtra_args: -c -v --xc --xp tvosUnitResults.xcresult
- codecov/upload:
flags: tvos-tests
upload_name: Coverage report for tvOS functional tests
xtra_args: -c -v --xc --xp tvosFunctionalResults.xcresult

build_xcframework_and_app:
macos:
xcode: 14.1.0 # Specify the Xcode version to use
Expand Down
4 changes: 2 additions & 2 deletions AEPEdge.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -364,17 +364,17 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D4ABABAE251A7D95008076BF /* AEPEdge.framework in Frameworks */,
783A5F4E903F9B6EABA50D23 /* Pods_UnitTests.framework in Frameworks */,
D4ABABAE251A7D95008076BF /* AEPEdge.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
D4D5B53024325AB700CAB6E4 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D4ABABAB251A7D41008076BF /* AEPEdge.framework in Frameworks */,
423B5033D43ADB49049383FB /* Pods_FunctionalTests.framework in Frameworks */,
D4ABABAB251A7D41008076BF /* AEPEdge.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
32 changes: 8 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ clean:
rm -rf build

clean-ios-test-files:
rm -rf iosresults.xcresult
rm -rf iosUnitResults.xcresult; \
rm -rf iosFunctionalResults.xcresult

clean-tvos-test-files:
rm -rf tvosresults.xcresult
rm -rf tvosUnitResults.xcresult; \
rm -rf tvosFunctionalResults.xcresult

pod-install:
pod install --repo-update
Expand Down Expand Up @@ -98,34 +100,16 @@ test-ios: clean-ios-test-files
@echo "### Testing iOS"
@echo "######################################################################"
@echo "List of available shared Schemes in xcworkspace"
xcodebuild -workspace $(PROJECT_NAME).xcworkspace -list
final_scheme=""; \
if xcodebuild -workspace $(PROJECT_NAME).xcworkspace -list | grep -q "($(PROJECT_NAME) project)"; \
then \
final_scheme="$(EXTENSION_NAME) ($(PROJECT_NAME) project)" ; \
echo $$final_scheme ; \
else \
final_scheme="$(EXTENSION_NAME)" ; \
echo $$final_scheme ; \
fi; \
xcodebuild test -workspace $(PROJECT_NAME).xcworkspace -scheme "$$final_scheme" -destination 'platform=iOS Simulator,name=iPhone 14' -derivedDataPath build/out -resultBundlePath iosresults.xcresult -enableCodeCoverage YES ADB_SKIP_LINT=YES
xcodebuild test -workspace AEPEdge.xcworkspace -scheme "UnitTests" -destination "platform=iOS Simulator,name=iPhone 14" -derivedDataPath build/out -resultBundlePath iosUnitResults.xcresult -enableCodeCoverage YES ADB_SKIP_LINT=YES; \
xcodebuild test -workspace AEPEdge.xcworkspace -scheme "FunctionalTests" -destination "platform=iOS Simulator,name=iPhone 14" -derivedDataPath build/out -resultBundlePath iosFunctionalResults.xcresult -enableCodeCoverage YES ADB_SKIP_LINT=YES

test-tvos: clean-tvos-test-files
@echo "######################################################################"
@echo "### Testing tvOS"
@echo "######################################################################"
@echo "List of available shared Schemes in xcworkspace"
xcodebuild -workspace $(PROJECT_NAME).xcworkspace -list
final_scheme=""; \
if xcodebuild -workspace $(PROJECT_NAME).xcworkspace -list | grep -q "($(PROJECT_NAME) project)"; \
then \
final_scheme="$(EXTENSION_NAME) ($(PROJECT_NAME) project)" ; \
echo $$final_scheme ; \
else \
final_scheme="$(EXTENSION_NAME)" ; \
echo $$final_scheme ; \
fi; \
xcodebuild test -workspace $(PROJECT_NAME).xcworkspace -scheme "$$final_scheme" -destination 'platform=tvOS Simulator,name=Apple TV' -derivedDataPath build/out -resultBundlePath tvosresults.xcresult -enableCodeCoverage YES ADB_SKIP_LINT=YES
xcodebuild test -workspace AEPEdge.xcworkspace -scheme "UnitTests" -destination 'platform=tvOS Simulator,name=Apple TV' -derivedDataPath build/out -resultBundlePath tvosUnitResults.xcresult -enableCodeCoverage YES ADB_SKIP_LINT=YES; \
xcodebuild test -workspace AEPEdge.xcworkspace -scheme "FunctionalTests" -destination 'platform=tvOS Simulator,name=Apple TV' -derivedDataPath build/out -resultBundlePath tvosFunctionalResults.xcresult -enableCodeCoverage YES ADB_SKIP_LINT=YES

install-githook:
git config core.hooksPath .githooks
Expand Down