-
Notifications
You must be signed in to change notification settings - Fork 151
(docs) Added steps in README to run unit tests and integration tests #732
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
Changes from 6 commits
6d44491
9ae6985
48ad047
9442b31
5d072f9
4bab177
9433dd3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,14 +46,8 @@ jobs: | |
| cache: true | ||
| cache-dependency-path: go.sum | ||
|
|
||
| - name: Start docker | ||
| run: | | ||
| docker compose -f internal/recipe/docker-compose.yml up -d | ||
| sleep 10 | ||
| - name: Provision Tables | ||
| run: | | ||
| docker compose -f internal/recipe/docker-compose.yml exec -T spark-iceberg ipython ./provision.py | ||
| sleep 10 | ||
| - name: Integration setup | ||
| run: make integration-setup | ||
|
|
||
| - name: Setup environment variables | ||
| run: | | ||
|
|
@@ -66,18 +60,17 @@ jobs: | |
| AWS_S3_ENDPOINT: "${{ env.AWS_S3_ENDPOINT }}" | ||
| AWS_REGION: "us-east-1" | ||
| run: | | ||
| go test -tags integration -v -run="^TestScanner" ./table | ||
| go test -tags integration -v ./io | ||
| go test -tags integration -v -run="^TestRestIntegration$" ./catalog/rest | ||
| go test -tags=integration -v ./catalog/hive/... | ||
| make integration-io | ||
| make integration-rest | ||
| make integration-spark | ||
| make integration-hive | ||
| - name: Run spark integration tests | ||
| env: | ||
| AWS_S3_ENDPOINT: "${{ env.AWS_S3_ENDPOINT }}" | ||
| AWS_REGION: "us-east-1" | ||
| SPARK_CONTAINER_ID: "${{ env.SPARK_CONTAINER_ID }}" | ||
| DOCKER_API_VER: "${{ env.DOCKER_API_VER }}" | ||
| run: | | ||
| go test -tags integration -v -run="^TestSparkIntegration" ./table | ||
| run: make integration-spark | ||
|
||
|
|
||
| - name: Show debug logs | ||
| if: ${{ failure() }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use it except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # golangci-lint version (keep in sync with CI and README) | ||
| GOLANGCI_LINT_VERSION := v2.8.0 | ||
|
|
||
| .PHONY: test lint lint-install integration-setup integration-test integration-scanner integration-io integration-rest integration-spark | ||
|
|
||
| test: | ||
| go test -v ./... | ||
|
|
||
| lint: | ||
| golangci-lint run --timeout=10m | ||
|
|
||
| lint-install: | ||
| go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) | ||
|
|
||
| integration-setup: | ||
| docker compose -f internal/recipe/docker-compose.yml up -d | ||
| sleep 10 | ||
| docker compose -f internal/recipe/docker-compose.yml exec -T spark-iceberg ipython ./provision.py | ||
| sleep 10 | ||
|
|
||
| integration-test: integration-scanner integration-io integration-rest integration-spark | ||
|
||
|
|
||
| integration-scanner: | ||
| go test -tags=integration -v -run="^TestScanner" ./table | ||
|
|
||
| integration-io: | ||
| go test -tags=integration -v ./io | ||
|
|
||
| integration-rest: | ||
| go test -tags=integration -v -run="^TestRestIntegration$$" ./catalog/rest | ||
|
|
||
| integration-spark: | ||
| go test -tags=integration -v -run="^TestSparkIntegration" ./table | ||
|
|
||
| integration-hive: | ||
| go test -tags=integration -v ./catalog/hive/... | ||
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.
use
make integration-testwhich automatically runs all four of these. It allows us to add new integration tests to the Makefile as we create them without needing to update this.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.
done