Skip to content

(docs) Added steps in README to run unit tests and integration tests#732

Merged
zeroshade merged 7 commits intoapache:mainfrom
subkanthi:update_readme_tests
Feb 19, 2026
Merged

(docs) Added steps in README to run unit tests and integration tests#732
zeroshade merged 7 commits intoapache:mainfrom
subkanthi:update_readme_tests

Conversation

@subkanthi
Copy link
Contributor

Added steps in README to run unit tests and integration tests

Comment on lines +47 to +80
### Linting

Run [golangci-lint](https://golangci-lint.run/) (matches CI):

```shell
golangci-lint run --timeout=10m
```

### Integration tests
1. Start the docker containers using docker compose.

```shell
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
```

2. export the required environment variables.

```shell
export AWS_S3_ENDPOINT=http://$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' minio):9000
export AWS_REGION=us-east-1
export SPARK_CONTAINER_ID=$(docker ps -qf 'name=spark-iceberg')
export DOCKER_API_VER=$(docker version -f '{{.Server.APIVersion}}')
```

3. Run the tests.
```shell
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 -run="^TestSparkIntegration" ./table
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we add a makefile to use both in CI and readme?

Otherwise, it might easily get outdated or golangci-lint version might be different, etc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we necessarily need a makefile, a simple shell script would likely be enough

Copy link
Member

@zeroshade zeroshade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we're going to add a Makefile, we should also update the CI workflows to use it, yes?

@github-actions github-actions bot added the INFRA label Feb 18, 2026
@subkanthi subkanthi changed the title Added steps in README to run unit tests and integration tests (docs) Added steps in README to run unit tests and integration tests Feb 18, 2026
Comment on lines +63 to +66
make integration-io
make integration-rest
make integration-spark
make integration-hive
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use make integration-test which 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines +67 to +73
- 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this as a separate step anymore? We can shift the env vars for SPARK_CONTAINER_ID and DOCKER_API_VER to the step above and just call make integration-test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

combined.

Makefile Outdated
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't integration-hive be part of this too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

- Added integration-hive to integration-test
@zeroshade
Copy link
Member

Thanks for this!

@zeroshade zeroshade merged commit 5015fca into apache:main Feb 19, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants