-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from DanRoscigno/allin1-tests
Test using the allin1 container
- Loading branch information
Showing
10 changed files
with
155 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Test with allin1 | ||
|
||
on: | ||
schedule: | ||
- cron: "5 9 * * 1" | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- 'ci/**/quickstart/basic/*' | ||
- '.github/workflows/test_with_allin1.yml' | ||
- 'allin1-docker-compose.yml' | ||
- 'quickstart_basic_test.go' | ||
- 'helper.go' | ||
- 'ginkgo.Dockerfile' | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- 'ci/**/quickstart/basic/*' | ||
- '.github/workflows/test_with_allin1.yml' | ||
- 'allin1-docker-compose.yml' | ||
- 'quickstart_basic_test.go' | ||
- 'helper.go' | ||
- 'ginkgo.Dockerfile' | ||
|
||
jobs: | ||
build: | ||
|
||
name: Build and test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checkout the repo as this CI needs: | ||
# - the compose file for StarRocks and Ginkgo/Gomega | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Golang | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'ci/go.mod' | ||
|
||
- name: Install ginkgo | ||
run: | | ||
version=$(cat go.mod| grep "ginkgo/v2" | awk '{print $2}') | ||
go install -v github.com/onsi/ginkgo/v2/ginkgo@$version | ||
working-directory: ./ci | ||
|
||
- name: Start StarRocks | ||
run: docker compose -f allin1-docker-compose.yml up --detach --wait --wait-timeout 60 | ||
|
||
# Any tests that will run against the StarRocks env would be | ||
# launched in steps like this one. Make sure to reset the | ||
# StarRocks environment after each run (remove any tables | ||
# and databases created, and reset any settings to the default) | ||
# | ||
# The ginkgo command uses `--focus-file` to run only the one test | ||
# file. | ||
- name: Test; Basic Quick Start | ||
if: always() | ||
env: | ||
AWS_S3_ACCESS_KEY: ${{ secrets.AWS_S3_ACCESS_KEY }} | ||
AWS_S3_SECRET_KEY: ${{ secrets.AWS_S3_SECRET_KEY }} | ||
run: ginkgo -v --focus-file=./quickstart_basic_test.go | ||
working-directory: ./ci | ||
|
||
# Add more tests here if there are other things | ||
# that should run against allin1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
version: "3.9" | ||
name: tests_using_allin1_container | ||
|
||
# Goal: a compose equivalent of: | ||
# "docker run -p 9030:9030 -p 8030:8030 -p 8040:8040 -itd --name quickstart starrocks/allin1-ubuntu" | ||
|
||
networks: | ||
allin1: | ||
|
||
services: | ||
allin1: | ||
image: starrocks/allin1-ubuntu:3.2-latest | ||
hostname: fe | ||
container_name: quickstart | ||
ports: | ||
- 9030:9030 | ||
- 8030:8030 | ||
- 8040:8040 | ||
user: root | ||
|
||
healthcheck: | ||
test: 'mysql -u root -h fe -P 9030 -e "show backends\G" |grep "Alive: true"' | ||
interval: 10s | ||
timeout: 5s | ||
retries: 6 | ||
networks: | ||
- allin1 | ||
|
||
# This section is commented out as the ports of the allin1 need to be | ||
# made available to the host env and the tests need to run from the | ||
# host. Leaving this in the file as I will need it for other | ||
# situations and need a reference. | ||
# test-harness: | ||
# extends: | ||
# file: ./test-harness-docker-compose.yml | ||
# service: test-harness | ||
# command: ash | ||
# tty: true | ||
# networks: | ||
# - allin1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/ash | ||
#!/bin/bash | ||
cd /tmp/ | ||
curl --silent --no-buffer \ | ||
-o /tmp/NYPD_Crash_Data.csv \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/ash | ||
#!/bin/bash | ||
cd /tmp/ | ||
curl --silent --no-buffer \ | ||
-o 72505394728.csv \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ RUN go install github.com/onsi/ginkgo/v2/[email protected] | |
|
||
RUN go mod download | ||
|
||
CMD ["ash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
## To Do | ||
|
||
1. Figure out why the curl command (see fail down at end of this file) fails. It is failing because the stream load forwards to `Failed to connect to 127.0.0.1 port 8040 after 0 ms: Couldn't connect to server` (I removed the `--silent` to see what the error is). Running the Ginkgo commands from localhost works (required editing all of the shell scripts to use bash and localhost instead of ash and fe). These changes should work from the github workflow also. | ||
|
||
So, run Gingkgo from a container when testing against separate FE and BE, and from the workflow when testing against allin1. | ||
1. Need to write the workflow file | ||
|
||
### Remember to export | ||
|
||
```bash | ||
export AWS_S3_SECRET_KEY=redacted | ||
export AWS_S3_ACCESS_KEY=redacted | ||
``` | ||
|
||
### Works | ||
|
||
```bash | ||
docker compose -f allin1-docker-compose.yml build | ||
``` | ||
|
||
### Works | ||
|
||
This starts the allin1 and the ginkgo container. The Ginkgo container just runs ash (shell) in the background and then I can use `docker compose exec` to run ginkgo commands. | ||
|
||
```bash | ||
docker compose -f allin1-docker-compose.yml up --detach --wait --wait-timeout 60 | ||
``` | ||
|
||
### This one works partially | ||
|
||
The connection to the database succeeds, the DDL commands work, but the curl to populate the crash data fails. | ||
|
||
```bash | ||
docker compose -f allin1-docker-compose.yml exec test-harness ginkgo -v --focus-file=./quickstart_basic_test.go | ||
``` | ||
|
||
### This command works | ||
|
||
```bash | ||
docker compose -f allin1-docker-compose.yml exec test-harness ginkgo -v --focus-file=./docs_test.go | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters