Skip to content

Commit

Permalink
Merging latest master into release for release 0.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar Batori committed Jun 29, 2020
2 parents ddcc753 + bd5aaa4 commit 1ea5bc7
Show file tree
Hide file tree
Showing 79 changed files with 4,685 additions and 730 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/bump-brew-formula.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ jobs:
steps:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
# GITHUB_REF is expected to be set in the format refs/tags/0.3.1
run: echo "::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}"
- uses: mislav/bump-homebrew-formula-action@v1
with:
formula-name: dolt
homebrew-tap: Homebrew/homebrew-core
base-branch: release
download-url: https://github.com/liquidata-inc/dolt/archive/v${{steps.get_version.outputs.VERSION}}.tar.gz
commit-message: ${{formulaName}} ${{version}}
download-url: ${{format('https://github.com/liquidata-inc/dolt/archive/v{0}.tar.gz', steps.get_version.outputs.VERSION)}}
commit-message: ${{format('dolt {0}', steps.get_version.outputs.VERSION)}}
env:
COMMITTER_TOKEN: ${{secrets.HOMEBREW_GITHUB_TOKEN}}
75 changes: 75 additions & 0 deletions .github/workflows/ci-bats-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Test Bats

on:
pull_request:
branches: [ master ]

jobs:
test:
name: Bats tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest, macos-latest ]
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-duration-seconds: 3600
- name: Setup Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go
- name: Setup Python 3.x
uses: actions/setup-python@v2
with:
python-version: ^3.6
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ^12
- name: Create CI Bin
run: |
mkdir -p ./.ci_bin
echo "::add-path::$(pwd)/.ci_bin"
- name: Install Bats
run: |
npm i bats
echo "::add-path::$(pwd)/node_modules/.bin"
working-directory: ./.ci_bin
- name: Install Doltpy
run: |
python3 -m pip install --upgrade pip
pip install doltpy
- name: Install Dolt
working-directory: ./go
run: |
go build -mod=readonly -o ../.ci_bin/dolt ./cmd/dolt/.
go build -mod=readonly -o ../.ci_bin/git-dolt ./cmd/git-dolt/.
go build -mod=readonly -o ../.ci_bin/git-dolt-smudge ./cmd/git-dolt-smudge/.
go build -mod=readonly -o ../.ci_bin/remotesrv ./utils/remotesrv/.
- name: Setup Dolt Config
run: |
dolt config --global --add user.name 'Liquidata Actions'
dolt config --global --add user.email '[email protected]'
- name: Install expect
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y expect
- name: Check expect
run: expect -v
- name: Test all
run: |
bats --tap .
working-directory: ./bats
env:
AWS_SDK_LOAD_CONFIG: "1"
AWS_REGION: "us-west-2"
DOLT_BATS_AWS_TABLE: "dolt-ci-bats-manifests-us-west-2"
DOLT_BATS_AWS_BUCKET: "dolt-ci-bats-chunks-us-west-2"
DOLT_BATS_AWS_EXISTING_REPO: "aws_remote_bats_tests"
32 changes: 32 additions & 0 deletions .github/workflows/ci-check-repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Check Formatting and Commiters

on:
pull_request:
branches: [ master ]

jobs:
verify:
name: Verify format and commiters
runs-on: ubuntu-latest
steps:
- name: Setup Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Check all
working-directory: ./go
# Keep this in sync with //go/utils/prepr/prepr.sh.
run: |
GOFLAGS="-mod=readonly" go build ./...
./utils/repofmt/check_fmt.sh
./Godeps/verify.sh
./utils/checkcommitters/check_pr.sh
go vet -mod=readonly ./...
go run -mod=readonly ./utils/copyrightshdrs/
env:
BRANCH_NAME: ${{ github.head_ref }}
CHANGE_TARGET: ${{ github.base_ref }}
44 changes: 44 additions & 0 deletions .github/workflows/ci-compatibility-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Check Compatibility

on:
pull_request:
branches: [ master ]

jobs:
test:
name: Compatibility Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
steps:
- name: Setup Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ^12
- name: Create CI Bin
run: |
mkdir -p ./.ci_bin
echo "::add-path::$(pwd)/.ci_bin"
- name: Install Bats
run: |
npm i bats
echo "::add-path::$(pwd)/node_modules/.bin"
working-directory: ./.ci_bin
- name: Install Dolt
working-directory: ./go
run: |
go build -mod=readonly -o ../.ci_bin/dolt ./cmd/dolt/.
- name: Setup Dolt Config
run: |
dolt config --global --add user.name 'Liquidata Actions'
dolt config --global --add user.email '[email protected]'
- name: Test all
run: ./runner.sh
working-directory: ./bats/compatibility
24 changes: 24 additions & 0 deletions .github/workflows/ci-go-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test Go

on:
pull_request:
branches: [ master ]

jobs:
test:
name: Go tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go
- uses: actions/checkout@v2
- name: Test All
working-directory: ./go
run: go test ./...
80 changes: 0 additions & 80 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,6 @@ pipeline {
stages {
stage('Test') {
parallel {
stage ("go/") {
agent {
kubernetes {
label "liquidata-inc-ld-build"
}
}
environment {
PATH = "${pwd()}/.ci_bin:${env.HOME}/go/bin:${env.PATH}"
}
steps {
dir ("go") {
// Keep this in sync with //go/utils/prepr/prepr.sh.
sh "go get -mod=readonly ./..."
sh "./utils/repofmt/check_fmt.sh"
sh "./Godeps/verify.sh"
sh "./utils/checkcommitters/check_pr.sh"
sh "go vet -mod=readonly ./..."
sh "go run -mod=readonly ./utils/copyrightshdrs/"
sh "go test -mod=readonly -test.v ./..."
}
}
}
stage ("bats/") {
agent {
kubernetes {
label "liquidata-inc-ld-build"
}
}
environment {
PATH = "${pwd()}/.ci_bin/pyenv/bin:${pwd()}/.ci_bin:${pwd()}/.ci_bin/node_modules/.bin:${env.PATH}"
AWS_SDK_LOAD_CONFIG = "1"
AWS_REGION = "us-west-2"
DOLT_BATS_AWS_TABLE = "dolt-ci-bats-manifests-us-west-2"
DOLT_BATS_AWS_BUCKET = "dolt-ci-bats-chunks-us-west-2"
DOLT_BATS_AWS_EXISTING_REPO = "aws_remote_bats_tests"
}
steps {
dir (".ci_bin") {
sh "npm i bats"
}
dir ("go") {
sh "go get -mod=readonly ./..."
sh "go build -mod=readonly -o ../.ci_bin/dolt ./cmd/dolt/."
sh "go build -mod=readonly -o ../.ci_bin/git-dolt ./cmd/git-dolt/."
sh "go build -mod=readonly -o ../.ci_bin/git-dolt-smudge ./cmd/git-dolt-smudge/."
sh "go build -mod=readonly -o ../.ci_bin/remotesrv ./utils/remotesrv/."
}
sh "python3 -m venv .ci_bin/pyenv"
sh "./.ci_bin/pyenv/bin/pip install doltpy"
sh "dolt config --global --add user.name 'Liquidata Jenkins'"
sh "dolt config --global --add user.email '[email protected]'"
dir ("bats") {
sh "bats ."
}
}
}
stage ("Windows") {
agent {
label "windows"
Expand Down Expand Up @@ -89,30 +33,6 @@ pipeline {
}
}
}
stage ("compatibility/") {
agent {
kubernetes {
label "liquidata-inc-ld-build"
}
}
environment {
PATH = "${pwd()}/.ci_bin:${pwd()}/.ci_bin/node_modules/.bin:${env.PATH}"
}
steps {
dir (".ci_bin") {
sh "npm i bats"
}
dir ("go") {
sh "go get -mod=readonly ./..."
sh "go build -mod=readonly -o ../.ci_bin/dolt ./cmd/dolt/."
}
sh "dolt config --global --add user.name 'Liquidata Jenkins'"
sh "dolt config --global --add user.email '[email protected]'"
dir ("bats/compatibility") {
sh "./runner.sh"
}
}
}
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions bats/1pksupportedtypes.bats
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ teardown() {
@test "boolean 1,0,true,false inserts and examine table" {
run dolt sql -q "insert into test values (0, 1, 'foo', 1, 1.11111111111111, 346, '123e4567-e89b-12d3-a456-426655440000')"
[ "$status" -eq 0 ]
run dolt sql -q "select * from test" boolean
run dolt sql -q "select * from test"
[ "$status" -eq 0 ]
[[ "${lines[1]}" =~ "boolean" ]] || false
[[ "${lines[3]}" =~ "1" ]] || false
run dolt sql -q "replace into test values (0, 1, 'foo', 0, 1.11111111111111, 346, '123e4567-e89b-12d3-a456-426655440000')"
[ "$status" -eq 0 ]
run dolt sql -q "select * from test" boolean
run dolt sql -q "select * from test"
[[ "${lines[3]}" =~ "0" ]] || false
run dolt sql -q "replace into test values (0, 1, 'foo', true, 1.11111111111111, 346, '123e4567-e89b-12d3-a456-426655440000')"
[ "$status" -eq 0 ]
run dolt sql -q "select * from test" boolean
run dolt sql -q "select * from test"
[[ "${lines[3]}" =~ "1" ]] || false
run dolt sql -q "replace into test values (0, 1, 'foo', false, 1.11111111111111, 346, '123e4567-e89b-12d3-a456-426655440000')"
[ "$status" -eq 0 ]
run dolt sql -q "select * from test" boolean
run dolt sql -q "select * from test"
[[ "${lines[3]}" =~ "0" ]] || false
}

Expand Down
1 change: 1 addition & 0 deletions bats/back-compat.bats
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ teardown() {
}

@test "back-compat: resolving conflicts" {
skip https://github.com/liquidata-inc/dolt/issues/773
for testdir in */; do
cd "$testdir"
run dolt migrate
Expand Down
2 changes: 2 additions & 0 deletions bats/conflict-detection.bats
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ SQL
}

@test "two branches add different column. merge. no conflict" {
skip https://github.com/liquidata-inc/dolt/issues/773
dolt sql <<SQL
CREATE TABLE test (
pk BIGINT NOT NULL,
Expand Down Expand Up @@ -384,6 +385,7 @@ SQL
}

@test "two branches delete different column. merge. no conflict" {
skip https://github.com/liquidata-inc/dolt/issues/773
dolt sql <<SQL
CREATE TABLE test (
pk BIGINT NOT NULL COMMENT 'tag:0',
Expand Down
4 changes: 3 additions & 1 deletion bats/export-tables.bats
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ INSERT INTO test VALUES
(2,'2020-04-08','12:12:12','2020','2020-04-08 12:12:12');
SQL
dolt table export test test.sql
cat test.sql
run cat test.sql
[[ "$output" =~ "INSERT INTO \`test\` (\`pk\`,\`v1\`,\`v2\`,\`v3\`,\`v4\`) VALUES (1,'2020-04-08','11:11:11','2020','2020-04-08 11:11:11');" ]] || false
[[ "$output" =~ "INSERT INTO \`test\` (\`pk\`,\`v1\`,\`v2\`,\`v3\`,\`v4\`) VALUES (2,'2020-04-08','12:12:12','2020','2020-04-08 12:12:12');" ]] || false
dolt table export test test.json
run cat test.json
[ "$output" = '{"rows": [{"pk":1,"v1":"2020-04-08","v2":"11:11:11","v3":"2020","v4":"2020-04-08 11:11:11"},{"pk":2,"v1":"2020-04-08","v2":"12:12:12","v3":"2020","v4":"2020-04-08 12:12:12"}]}' ]
}

@test "dolt table import from stdin export to stdout" {
Expand Down
Loading

0 comments on commit 1ea5bc7

Please sign in to comment.