diff --git a/.github/workflows/pull_requests.yaml b/.github/workflows/pull_requests.yaml index 9e55eb0431..4986e29fe6 100644 --- a/.github/workflows/pull_requests.yaml +++ b/.github/workflows/pull_requests.yaml @@ -118,6 +118,76 @@ jobs: fail_ci_if_error: true files: ./coverage-integration.txt, ./coverage-unit.txt verbose: true + Compile-and-upload-binaries: + runs-on: ubuntu-latest-8-cores + steps: + - uses: actions/checkout@v3 + - name: Set up Go + uses: actions/setup-go@v4 + with: + # we cannot use 1.20.6 version of go bc of a bug in go 1.20.6 that affects testcontainers + # should be changed back '1.20' once this is fixed + go-version: '1.20.5' + cache: true + - name: goreleaser + run: | + echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list + sudo apt update + sudo apt install goreleaser + GIT_HASH=$(git rev-parse --short HEAD) goreleaser build --clean --snapshot + - name: Upload macos + uses: actions/upload-artifact@v3 + with: + name: binaries-macos-unsigned + path: dist/weaviate_darwin_all + - name: Upload windows + uses: actions/upload-artifact@v3 + with: + name: binaries-windows-amd64 + path: dist/weaviate_windows_amd64_v1 + - name: Upload windows + uses: actions/upload-artifact@v3 + with: + name: binaries-windows-arm64 + path: dist/weaviate_windows_arm64 + - name: Upload linux amd64 + uses: actions/upload-artifact@v3 + with: + name: binaries-linux-amd64 + path: dist/weaviate_linux_amd64_v1 + - name: Upload linux arm64 + uses: actions/upload-artifact@v3 + with: + name: binaries-linux-arm64 + path: dist/weaviate_linux_arm64 + + + Acceptance-Tests-windows: + needs: Compile-and-upload-binaries + runs-on: windows-latest + env: + AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: true + PERSISTENCE_DATA_PATH: /tmp + QUERY_DEFAULTS_LIMIT: 20 + steps: + - uses: actions/checkout@v3 + - name: Download binaries + uses: actions/download-artifact@v3 + with: + name: binaries-windows-amd64 + - name: Set up Go + uses: actions/setup-go@v4 + with: + # we cannot use 1.20.6 version of go bc of a bug in go 1.20.6 that affects testcontainers + # should be changed back '1.20' once this is fixed + go-version: '1.20.5' + cache: true + - name: start weaviate + shell: bash + run: ./weaviate.exe --scheme http --port 8080 & + - name: run acceptance tests + shell: bash + run: go test -count 1 -race test/acceptance/actions/*.go Push-Docker: needs: [Acceptance-Tests, Modules-Acceptance-Tests, Unit-Tests, Integration-Tests, Vulnerability-Scanning, Run-Swagger] diff --git a/.goreleaser.yaml b/.goreleaser.yaml index ebbd13cb29..7a8b61343c 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -8,6 +8,7 @@ builds: goos: - linux - darwin + - windows main: ./cmd/weaviate-server goarch: - amd64 diff --git a/test/acceptance/run.sh b/test/acceptance/run.sh new file mode 100755 index 0000000000..588550e11c --- /dev/null +++ b/test/acceptance/run.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -eou pipefail + +function main() { + # needed for test/docker package during replication tests + export TEST_WEAVIATE_IMAGE=weaviate/test-server + # for now we need to run the tests sequentially, there seems to be some sort of issues with running them in parallel + for pkg in $(go list ./... | grep 'test/acceptance' | grep -v 'test/acceptance/stress_tests' ); do + if ! go test -count 1 -race "$pkg"; then + echo "Test for $pkg failed" >&2 + return 1 + fi + done + for pkg in $(go list ./... | grep 'test/acceptance/stress_tests' ); do + if ! go test -count 1 "$pkg"; then + echo "Test for $pkg failed" >&2 + return 1 + fi + done + # tests with go client are in a separate package with its own dependencies to isolate them + cd 'test/acceptance_with_go_client' + for pkg in $(go list ./... ); do + if ! go test -count 1 -race "$pkg"; then + echo "Test for $pkg failed" >&2 + return 1 + fi + done +} + +main "$@" \ No newline at end of file diff --git a/test/run.sh b/test/run.sh index 03121a8c13..ac94f9ac40 100755 --- a/test/run.sh +++ b/test/run.sh @@ -118,29 +118,7 @@ function run_integration_tests() { } function run_acceptance_tests() { - # needed for test/docker package during replication tests - export TEST_WEAVIATE_IMAGE=weaviate/test-server - # for now we need to run the tests sequentially, there seems to be some sort of issues with running them in parallel - for pkg in $(go list ./... | grep 'test/acceptance' | grep -v 'test/acceptance/stress_tests' ); do - if ! go test -count 1 -race "$pkg"; then - echo "Test for $pkg failed" >&2 - return 1 - fi - done - for pkg in $(go list ./... | grep 'test/acceptance/stress_tests' ); do - if ! go test -count 1 "$pkg"; then - echo "Test for $pkg failed" >&2 - return 1 - fi - done - # tests with go client are in a separate package with its own dependencies to isolate them - cd 'test/acceptance_with_go_client' - for pkg in $(go list ./... ); do - if ! go test -count 1 -race "$pkg"; then - echo "Test for $pkg failed" >&2 - return 1 - fi - done + ./test/acceptance/run.sh --include-slow } function run_module_tests() {