-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[iOS] add an unit test target to TestApp #29962
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
Conversation
shoumikhin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we run clang-format on it?
| } | ||
| torch::autograd::AutoGradMode guard(false); | ||
| _module = torch::jit::load(std::string(modelPath.UTF8String)); | ||
| _module.eval(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe better to have it in each test, since some tests may actually want to change module's parameters in future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what parameters could be changed?
| @@ -0,0 +1,38 @@ | |||
| #import <XCTest/XCTest.h> | |||
| #import <torch/script.h> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: #include C++ headers?
Also, may like an LF between the two, since they belong to different types of headers
| [super setUp]; | ||
| NSString* modelPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"model" | ||
| ofType:@"pt"]; | ||
| XCTAssertTrue([[NSFileManager defaultManager] fileExistsAtPath:modelPath], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: dot-syntax for the class property?
| at::globalContext().setQEngine(at::QEngine::QNNPACK); | ||
| } | ||
| torch::autograd::AutoGradMode guard(false); | ||
| _module = torch::jit::load(std::string(modelPath.UTF8String)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: probably no need to convert char* to std::string explicitly?
### Summary Recently we've found that the master branch was constantly broken due to some unwanted change being landed on mobile. The problem is that our CI was not able to detect the runtime errors. Starting from this PR, we'll add some unit tests to the iOS Simulator build. As follows: 1. Add an unit test target to XCode (this PR) 2. Use Fastlane to run the tests on CI 3. Modify the CI scripts to trigger tests ### Test Plan - Don't break the existing CI jobs unless they are flaky.
I did. |
shoumikhin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
### Summary Recently we've found that the master branch was constantly broken due to some unwanted change being landed on mobile. The problem is that our CI was not able to detect the runtime errors. ### Previous work - Add an unit test target to the iOS TestApp ( #29962 ) - Update Fastlane to run tests ( #29963 ) ### What's been changed in CI 1. XCode version has been updated to 11.2.1 2. For iOS simulator build, we'll run some unit tests( currently only one) after the build test. Differential Revision: [D18641413](https://our.internmc.facebook.com/intern/diff/D18641413)
### Summary Recently we've found that the master branch was constantly broken due to some unwanted change being landed on mobile. The problem is that our CI was not able to detect the runtime errors. ### Previous work - Add an unit test target to the iOS TestApp ( #29962 ) - Update Fastlane to run tests ( #29963 ) ### What's been changed in CI 1. XCode version has been updated to 11.2.1 2. For iOS simulator build, we'll run some unit tests( currently only one) after the build test. Differential Revision: [D18641413](https://our.internmc.facebook.com/intern/diff/D18641413)
### Summary Recently we've found that the master branch was constantly broken due to some unwanted change being landed on mobile. The problem is that our CI was not able to detect the runtime errors. ### Previous work - Add an unit test target to the iOS TestApp ( #29962 ) - Update Fastlane to run tests ( #29963 ) ### What's been changed in CI 1. XCode version has been updated to 11.2.1 2. For iOS simulator build, we'll run some unit tests( currently only one) after the build test. Differential Revision: [D18641413](https://our.internmc.facebook.com/intern/diff/D18641413)
### Summary Recently we've found that the master branch was constantly broken due to some unwanted change being landed on mobile. The problem is that our CI was not able to detect the runtime errors. ### Previous work - Add an unit test target to the iOS TestApp ( #29962 ) - Update Fastlane to run tests ( #29963 ) ### What's been changed in CI 1. XCode version has been updated to 11.2.1 2. For iOS simulator build, we'll run some unit tests( currently only one) after the build test. Differential Revision: [D18641413](https://our.internmc.facebook.com/intern/diff/D18641413)
Summary: Pull Request resolved: #30133 ### Summary Recently we've found that the master branch was constantly broken due to some unwanted change being landed on mobile. The problem is that our CI was not able to detect the runtime errors. ### Previous work - Add an unit test target to the iOS TestApp ( #29962 ) - Update Fastlane to run tests ( #29963 ) ### What's been changed in CI 1. XCode version has been updated to 11.2.1 2. For iOS simulator build, we'll run some unit tests( currently only one) after the build test. Test Plan: Imported from OSS Differential Revision: D18641413 Pulled By: xta0 fbshipit-source-id: 12942206f1dee045b2addba3ae618760e992752c
Stack from ghstack:
Summary
Recently we've found that the master branch was constantly broken due to some unwanted change being landed on mobile. The problem is that our CI was not able to detect the runtime errors. Starting from this PR, we'll add some unit tests to the iOS Simulator build. As follows:
Test Plan
Differential Revision: D18582908