Skip to content
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

Swift 5.1 #14

Merged
merged 5 commits into from
Oct 10, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0
5.1
95 changes: 48 additions & 47 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,56 @@
os:
- linux
- osx
language: generic
sudo: required
dist: trusty
osx_image: xcode10.2
services: docker

before_install:
- if [ $TRAVIS_OS_NAME == "linux" ]; then
SWIFT_VERSION=$(<.swift-version);
docker pull swift:${SWIFT_VERSION}-xenial;
docker pull mongo:4.0.8;
docker run -d -p 27017:27017 mongo:4.0.8;
elif [ $TRAVIS_OS_NAME == "osx" ]; then
rvm use 2.5.1 --install --binary --fuzzy;
ruby --version;
gem install bundler;
bundle --version;
brew update;
brew install mongo-c-driver;
brew install mongodb;
brew services start mongodb;
brew outdated swiftlint || brew upgrade swiftlint;
fi
- export SWIFT_VERSION=$(<.swift-version)
- export SWIFT_DOCKER_IMAGE=swift:${SWIFT_VERSION}-bionic
- export MONGO_DOCKER_IMAGE=mongo:4.0.12

install:
- if [ $TRAVIS_OS_NAME == "osx" ]; then
bundle install --jobs=3 --retry=3 --deployment;
fi
stages:
- name: test
if: tag IS NOT present

script:
- if [ $TRAVIS_OS_NAME == "osx" ]; then
swift --version;
swift build;
swift build -c release;
swift test;
swiftlint;
else
args="apt-get update
&& apt-get -y install cmake
&& git clone -b r1.14 https://github.com/mongodb/mongo-c-driver /tmp/libmongoc
&& pushd /tmp/libmongoc
&& cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr
&& make -j8 install
&& popd
&& swift build
&& swift build -c release
&& swift test";
docker run --rm --net=host -v $(pwd):/app --workdir /app swift:${SWIFT_VERSION}-xenial bash -c "${args}";
fi
jobs:
include:

- stage: test
name: Unit Tests
os: linux
dist: bionic
services: docker
script:
- docker pull ${SWIFT_DOCKER_IMAGE}
- docker pull ${MONGO_DOCKER_IMAGE}
- docker run -d -p 27017:27017 ${MONGO_DOCKER_IMAGE}
- args="apt-get update
&& apt-get -y install cmake
&& git clone -b r1.14 https://github.com/mongodb/mongo-c-driver /tmp/libmongoc
&& pushd /tmp/libmongoc
&& cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr
&& make -j8 install
&& popd
&& swift build -c debug
&& swift build -c release
&& swift test -c debug --sanitize=thread --enable-test-discovery";
- docker run --rm --net=host -v $(pwd):/app --workdir /app ${SWIFT_DOCKER_IMAGE} bash -c "${args}"

- stage: test
name: Unit Tests
os: osx
osx_image: xcode11
before_script:
- gem install bundler
- bundle install
- brew update
- brew install mongo-c-driver
- brew install mongodb
- brew outdated swiftlint || brew upgrade swiftlint
- brew services start mongodb
script:
- swift --version
- swift build
- swift build -c release
- swift test
- swiftlint

notifications:
email:
Expand Down
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:5.1

//
// Package.swift
Expand All @@ -16,8 +16,8 @@ let package = Package(
.library(name: "FluentMongo", targets: ["FluentMongo"])
],
dependencies: [
.package(url: "https://github.com/vapor/core.git", .upToNextMajor(from: "3.8.1")),
.package(url: "https://github.com/vapor/fluent.git", .upToNextMajor(from: "3.2.0")),
.package(url: "https://github.com/vapor/core.git", .upToNextMajor(from: "3.9.2")),
.package(url: "https://github.com/vapor/fluent.git", .upToNextMajor(from: "3.2.1")),
.package(url: "https://github.com/mongodb/mongo-swift-driver.git", .upToNextMinor(from: "0.1.3"))
],
targets: [
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vapor-fluent-mongo

![Swift](https://img.shields.io/badge/swift-5.0-orange.svg)
![Swift](https://img.shields.io/badge/swift-5.1-orange.svg)
[![Build Status](https://travis-ci.com/asensei/vapor-fluent-mongo.svg?token=eSrCssnzja3G3GciyhUB&branch=master)](https://travis-ci.com/asensei/vapor-fluent-mongo)

Mongo driver for Fluent `3.x`.
Expand Down Expand Up @@ -29,7 +29,7 @@ On Linux: please follow the [instructions](http://mongoc.org/libmongoc/current/i
Add FluentMongo to your dependencies in `Package.swift`:

```swift
// swift-tools-version:5.0
// swift-tools-version:5.1
import PackageDescription

let package = Package(
Expand Down
26 changes: 0 additions & 26 deletions Tests/FluentMongoTests/FluentMongoProviderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,6 @@ import MongoSwift

class FluentMongoProviderTests: XCTestCase {

static let allTests = [
("testIndex", testIndex),
("testNestedIndex", testNestedIndex),
("testModels", testModels),
("testError", testError),
("testFilterCollectionInSubset", testFilterCollectionInSubset),
("testAddToSet", testAddToSet),
("testPush", testPush),
("testPullAll", testPullAll),
("testJoin", testJoin),
("testDistinct", testDistinct),
("testMigration", testMigration),
//("testBenchmarkModels", testBenchmarkModels),
("testBenchmarkUpdate", testBenchmarkUpdate),
("testBenchmarkBugs", testBenchmarkBugs),
("testBenchmarkSort", testBenchmarkSort),
("testBenchmarkRange", testBenchmarkRange),
("testBenchmarkSubset", testBenchmarkSubset),
("testBenchmarkChunking", testBenchmarkChunking),
("testBenchmarkAggregate", testBenchmarkAggregate),
("testBenchmarkLifecycle", testBenchmarkLifecycle),
("testBenchmarkAutoincrement", testBenchmarkAutoincrement),
("testBenchmarkTimestampable", testBenchmarkTimestampable),
("testBenchmarkJoins", testBenchmarkJoins)
]

var benchmarker: Benchmarker<FluentMongo.MongoDatabase>!

var database: FluentMongo.MongoDatabase!
Expand Down
11 changes: 0 additions & 11 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,3 @@
// Created by Valerio Mazzeo on 18/12/2018.
// Copyright © 2018 Asensei Inc. All rights reserved.
//

#if os(Linux)

import XCTest
@testable import FluentMongoTests

XCTMain([
testCase(FluentMongoProviderTests.allTests)
])

#endif