Skip to content

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

Open
subkanthi wants to merge 2 commits intoapache:mainfrom
subkanthi:update_readme_tests
Open

Added steps in README to run unit tests and integration tests#732
subkanthi wants to merge 2 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants