Commit Graph
24 Commits
Author SHA1 Message Date
Sebastian Schmidt 41c411e8f4 Add QueryData.with() helpers (#3991) 2019-10-03 14:52:12 -07:00
Konstantin Varlamov 5da6b69a7d Fix accessing a destroyed object (#3721)
This was caused by running under Asan with XCode 11. Apparently, previous versions of XCode cannot catch it (which is why Travis is passing, apparently).

Also:
* enable "Detect use of stack after return" option for Asan. AFAIU, it can only be enabled in the scheme. It's already enabled for unit tests, this PR additionally enables it for integration tests;
* make Asan failures fail Travis build. They were originally not considered blocking due to some sporadic failures. I haven't seen those for some time, and worst case scenario, we can revert this change.
2019-08-29 14:14:09 -04:00
Gil 37affc1eb4 Have Firestore integration tests run all tests (#3342)
* Rename FIRQueryTests to FIRQueryUnitTests

* Make IntegrationTests targets run everything

The incremental cost of running all tests is an extra two seconds of run
time, but not starting the simulator three times during a build cuts
build times by ~25%.

* sync_project.rb generated changes

* sync_project.rb generated changes

* Remove AllTests_iOS aggregate target

* Add unit test deps to Firestore_IntegrationTests_*

* Fix BasicCompileTests on macOS and tvOS

* Run Firestore IntegrationTests only on Travis

This cuts build time for the job by about 25%, primarily due to not
having to start/deploy to the simulator repeatedly.
2019-07-12 15:57:03 -07:00
Gil 3d0c97ecf5 Manage configuration for benchmarks and fuzz tests and fix them (#3335)
* Fix leveldb benchmarks

... which apparently haven't been built in a while

* Manage configuration for Benchmarks and FuzzTests

* Suppress warnings in LibFuzzer

* Add a Firestore_Benchmarks_iOS scheme

* xcodeproj: Remove manual configuration for Fuzzer and Benchmarks

* Update LibFuzzer build for recent clangs

Builds are currently failing with this on standard out:

    -fsanitize-coverage=trace-pc-guard is no longer supported by
    libFuzzer.  Please either migrate to a compiler that supports
    -fsanitize=fuzzer or use an older version of libFuzzer
2019-07-11 15:58:30 -07:00
Sebastian Schmidt 6db6cc7909 Store the coerced base value in the BaseMutation (#3292) 2019-07-03 08:45:31 -07:00
Gil 0729c9dfe9 Add tvOS support to Firestore (#2662)
* Create tvOS host app

* Standard project edits

  * Remove code signing
  * Force C99/C++11
  * Adjust plist file for new location
  * header search paths
  * LDFLAGS

* Add Firestore_{Tests,IntegrationTests}_tvOS

* Add tvOS tests to the Podfile

* Add Firestore tvOS xcodebuild to build.sh

* Teach sync_project to keep tvOS up-to-date

* Add Firestore tvOS to Travis
2019-03-28 11:43:43 -07:00
Gil 13c1c80a48 Add support for running Firestore integration tests (#2660)
* Add Firestore_IntegrationTests_macOS to Xcode

* Change deployment target from 10.14 to 10.10

* Make standard target edits

  * Force C99/C++11
  * Use shared test info.plist
  * Remove CODE_SIGN_IDENTITY

* Add Firestore_IntegrationTests_macOS to the Podfile

* Have sync_project handle macOS integration tests

* Pod install and sync_project

* Add header search paths and ldflags

* Build integration tests on macos

* Remove integration tests from unit tests

* Make Firestore_IntegrationTests_macOS buildable from the command-line
2019-03-27 16:05:55 -07:00
Gil c2a10a9f86 Add support for Firestore unit tests on macOS (#2641)
* Rename Firestore/Example/App/macOS_example to macOS

* Update paths to macOS and names to Firestore_Example_macOS

* Add Firestore_Tests_macOS target

This uses a shared Tests Info.plist. This is important because it
configures NSPrincipalClass

* Teach sync_project about Firestore_Tests_macOS

* Add files to Firestore_Tests_macOS

* Add Firestore_Tests_macOS target to the Podfile

* Add HEADER_SEARCH_PATHS to match iOS

* Force C99/C++11 conformance

* pod install after adding Firestore_Tests_macOS

* Get macOS tests to link

* Add spec test json files to the macOS tests

* Remove development code signing

* Disable app sandboxing to allow GoogleTest death tests to succeed.
2019-03-26 14:51:57 -07:00
Gil 9c95d61304 Update project and fix warnings (#2531)
* Update Firestore project to Xcode 10.1 defaults

* Fix NSUInteger in format strings warning

* Fix implicit conversion warning in FSTLevelDB

* Fix BOOL/bool mismatch

* Fix erroneous comparison

This failure shows up on 32-bit targets. I have no idea why this
succeeds on 64-bit targets.

* Fix incorrect type inference with explicit cast

clang is inferring the type of the key in these maps is `NSString *` and
then complaining that `FIRFieldValue *` doesn't match that type, despite
the underlying method taking `NSDictionary<id, id>`. Explicitly casting
to `id` prevents the warning.

* Remove reliance on representation in FSTFieldValue tests

On *some* platforms [NSNumber numberWithChar:1] ends up with a "c"
(signed char) objcType, but apparently on 32-bit platforms this ends up
as "i" (signed int). Rather than relying on this working properly just
test that [NSNumber numberWithBool:] does the right thing.

* Fix field_value_test on 32-bit targets

When sizeof(void*) is 4 the test failed :-(.

* Rephrase testWritesWithLargeNumbersFail in terms of fixed size types

The prior definition only worked on LP64. Switching to LLONG_MAX would
have also fixed this, but Firestore's data model is independent of C's
data model, so rewriting this in terms of fixed size types more closely
models what's actually an invalid value.

* Fix implicit retain self warnings
2019-03-12 15:58:52 -07:00
Paul Harter 2c03cf16f7 Example of Firestore working in macOS app (#2241)
Besides adding a new macOS example to the project, this:
* Adds a search for roots.pem in root of main bundle
* Accepts swiftformat 0.37 in `style.sh`
* Extends the travis_wait from the default 20 mins to 45 to allow for building iOS and macOS.
2019-01-17 12:37:42 -08:00
Konstantin Varlamov 5038e26b20 Fix string_view referring to an out-of-scope string (#2074) 2018-11-13 20:04:14 -05:00
Konstantin Varlamov 8b1efabd82 gRPC: replace Objective-C implementation with the new C++ implementation (#2068)
* Revert "Revert "gRPC: replace Objective-C implementation with the new C++ implementation (#1968)" (#2030)"

This reverts commit ea567dca47.

* gRPC: fix bugs found during testing (#2039)

All in `GrpcStream`:
* make sure there are no pending completions when "finish" operation is enqueued;
* always finish gRPC calls;
* when connectivity changes, reset not just the calls, but the underlying channel as well.

* Revert "Partially revert "Update CHANGELOG for Firestore v0.14.0 (#2025)" (#2031)"

This reverts commit b2437b80f6.

* Update changelog for v0.15.0.

* gRPC: add gRPC wrapper classes to CMake build (#2015)

* add a C++ equivalent of `FIRFirestoreVersionString`. This eliminates the only Objective-C dependency of `grpc_connection.mm` and allows making it a pure C++ file;
* open-source `binary_to_array.py` script and use it in the build to embed `roots.pem` certificate file from gRPC into the Firestore binary. The embedded char array is then used to load certificate at runtime.

* Revert local change -- do not enable sanitizers by default
2018-11-13 11:51:06 -08:00
Mina Farid b5afc6b522 Run fuzzing as a travis cron job (#1662)
* Added fuzzing script to run all fuzzing targets on cron jobs.
* Added travis fuzzing script and `FUZZING_DURATION` to control fuzzing time.
* Given a total fuzzing duration, select 1 target to run for half of
  the duration, and divide the remaining duration over the rest of
  targets equally.
2018-08-16 18:20:08 -04:00
Mina Farid ab8ec2d725 Multiple fuzz testing targets (#1550)
* Read fuzzing target `FUZZING_TARGET` environment variable.
2018-07-19 17:02:02 -04:00
Gil e963b606f3 Migrate contents of SwiftBuildTest to Firestore_SwiftTests_iOS (#1524)
* Move main.swift to BasicCompileTests.swift

* Remove SwiftBuildTest from the Podfile, Xcode project, build.sh

Add Firestore_SwiftTests_iOS, but only if building with Xcode 9 or
better.
2018-07-15 10:44:01 -07:00
Gil 09c75c4fb8 Fix Firestore when compiled with Xcode 8.3 (#1519)
* Add a travis stage that tests building Firestore with Xcode 8.3.

* Simulate on a device available in Xcode 8

* Fix compile errors under Xcode 8.3.3

* Remove Firestore_SwiftTests_iOS from the Firestore_Tests_iOS Scheme

I'll create a new target for this but in another PR.

* Add an entry to CHANGELOG.md
2018-07-11 19:21:48 -07:00
Greg Soltis 1579c3809d Remove Limbo Document GC (#1413)
* Remove usage of eager garbage collector for tracking limbo document references

* Fix style
2018-06-20 12:15:00 -07:00
Mina Farid f5bf0a37a7 Fuzz testing Header Search Paths settings (#1395)
* Modified `HEADER_SEARCH_PATHS` in the project file.
2018-06-11 17:23:07 -04:00
Sebastian Schmidt 83fc5714b2 Adding AppCode schema for Fuzz tests (#1388) 2018-06-07 08:56:37 -07:00
Mina Farid a135ee1717 Add a new Xcode target and scheme for fuzz tests (#1364)
Created `Firestore_FuzzTests_iOS` Xcode target as a duplicate of the target
  `Firestore_Tests_iOS`.
    - Added `-fsanitize-coverage=trace-pc-guard` to the compiler flags to enable
      code coverage by libFuzzer fuzzing driver.
    - Modified the files to compile to the fuzz testing ones.
    - Added a Principal testing class.
* Modified the `Podfile` to include `LibFuzzer.podspec` as a dependency for
  the target `Firestore_FuzzTests_iOS`.
* Added a skeleton for fuzz testing. Currently does not test any code but
  the fuzzing works fine and calls an empty `LLVMFuzzerTestOneInput`
  with different input values.
    - This means that fuzzing does not finish or crash.
2018-06-04 14:36:55 -04:00
Gil 83a309df0a Rename iOS-specific targets with iOS-specific names (#1150)
* Rename targets:
  * Firestore_Example to Firestore_Example_iOS
  * Firestore_Tests to Firestore_Tests_iOS
  * Firestore_IntegrationTests to Firestore_IntegrationTests_iOS
  * AllTests to AllTests_iOS

* Rename associated schemes the same way

* Update Podfile to reference the new targets
2018-04-20 09:57:31 -07:00
Gil 13e3667384 Add build infrastructure for Codable support in Firestore (#815)
* Add Firestore_SwiftTests_iOS target to Xcode

* Add FirebaseFirestoreSwift podspec

* Add Firestore_SwiftTests_iOS to the Podfile

* Add CodableGeoPoint and tests

* Version FirebaseFirestoreSwift separately
2018-02-26 08:09:28 -08:00
Gil 4dc63f8d7c Fix Firestore tests for M22 (#834)
* Add FIRFirestoreTests to the Firestore Xcode project

* Avoid waitForExpectations:timeout:

This API was added in Xcode 8.3, but we still build production releases
with Xcode 8.2. waitForExpectationsWithTimeout:handler: is available
from Xcode 7.2.

* Add AppForUnitTesting

Add a utility for constructing a Firebase App for testing.

* Handle the nil UID from FIRAuth

* Avoid running CMake tests twice

* Only build app_testing on Apple platforms

* Revise test.sh messages
2018-02-22 08:26:22 -08:00
Gil bde743ed25 Release 4.3.0 (#327)
Initial release of Firestore at 0.8.0
Bump FirebaseCommunity to 0.1.3
2017-10-03 08:55:22 -07:00