server/tests-py: Remove the old local and CI runners.

We no longer need these!

Next up:

1. renaming anything with "new" in the name (because we don't have an "old" any more)
2. removing the server upgrade/downgrade tests (I am sure this is controversial)
3. deleting a lot of Python code

[NDAT-259]: https://hasurahq.atlassian.net/browse/NDAT-259?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8841
GitOrigin-RevId: df026d4a19dc0cf5c8730d41eafae5eebb6f6f50
This commit is contained in:
Samir Talwar 2023-04-20 16:20:32 +02:00 committed by hasura-bot
parent 1846307cd6
commit 71430082f2
2 changed files with 0 additions and 154 deletions

View File

@ -5,74 +5,6 @@ version: "3.6"
name: hge-python-tests
services:
cabal-update:
image: hasura/graphql-engine-server-builder:${DOCKER_PLATFORM:-}-${HASURA_GRAPHQL_ENGINE_SERVER_BUILDER_SHA}
command:
- cabal
- update
volumes:
- .:/src
- hge-dist:/src/dist-newstyle
- cabal-cache:/root/.cabal
working_dir: /src
hge-build:
image: hasura/graphql-engine-server-builder:${DOCKER_PLATFORM:-}-${HASURA_GRAPHQL_ENGINE_SERVER_BUILDER_SHA}
command:
- sh
- -c
- |
set -ex
cabal build graphql-engine:exe:graphql-engine
cabal list-bin graphql-engine:exe:graphql-engine > dist-newstyle/bin.txt
volumes:
- ../..:/src
- /dev/null:/src/cabal.project.local # don't include cabal.project.local in build
- hge-dist:/src/dist-newstyle
- cabal-cache:/root/.cabal
working_dir: /src
depends_on:
cabal-update:
condition: service_completed_successfully
tests-py:
build:
context: ../..
dockerfile: ./.buildkite/dockerfiles/server-pytest-runner/Dockerfile
image: hasura/graphql-engine-server-pytest-runner:${HASURA_GRAPHQL_ENGINE_SERVER_PYTEST_RUNNER_SHA}
command:
- sh
- -c
- |
set -ex
export GRAPHQL_ENGINE="$$(cat dist-newstyle/bin.txt)"
./oss-.circleci/test-server.sh
environment:
- CIRCLE_NODE_INDEX=1
- CIRCLE_NODE_TOTAL=1
- OUTPUT_FOLDER=/output
- HASURA_GRAPHQL_DATABASE_URL=postgresql://postgres:hasura@hge-python-tests-postgres-1/postgres
- HASURA_GRAPHQL_DATABASE_URL_2=postgresql://postgres:hasura@hge-python-tests-postgres-2/postgres
- HASURA_GRAPHQL_CITUS_SOURCE_URL=postgresql://postgres:hasura@citus/postgres
- HASURA_GRAPHQL_MSSQL_SOURCE_URL=DRIVER={ODBC Driver 18 for SQL Server};SERVER=sqlserver,1433;Uid=sa;Pwd=Password!;Encrypt=optional
- HASURA_GRAPHQL_PG_SOURCE_URL_1=postgresql://postgres:hasura@hge-python-tests-postgres-1/postgres
- HASURA_GRAPHQL_PG_SOURCE_URL_2=postgresql://postgres:hasura@hge-python-tests-postgres-2/postgres
- HASURA_BIGQUERY_PROJECT_ID
- HASURA_BIGQUERY_SERVICE_KEY
- SERVER_TEST_TO_RUN
volumes:
- ../..:/src
- hge-dist:/src/dist-newstyle
- output:/output
working_dir: /src
depends_on:
postgres:
condition: service_healthy
citus:
condition: service_healthy
sqlserver-healthcheck:
condition: service_healthy
postgres:
extends:
file: ../../docker-compose/databases.yaml
@ -103,8 +35,3 @@ services:
depends_on:
sqlserver:
condition: service_started
volumes:
cabal-cache:
hge-dist:
output:

View File

@ -1,81 +0,0 @@
#!/usr/bin/env bash
# This allows a developer, through Docker, to run the Python integration tests in pretty
# much exactly the same way as CI does (in contrast to `dev.sh test --integration`),
# allowing us to more readily diagnose issues locally.
#
# This takes an optional test configuration argument, corresponding to a name in
# `oss-.circleci/server-test-names.txt` (else defaulting to `no-auth`).
#
# See `case "$SERVER_TEST_TO_RUN"` in `oss-.circleci/test-server.sh` for what
# these actually do.
set -e
set -u
set -o pipefail
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
# This `PLATFORM` value is used to pick the correct server builder image and HGE binary path.
PLATFORM="$(uname -m)"
if [[ "$PLATFORM" == 'x86_64' || "$PLATFORM" == 'amd64' ]]; then
CABAL_PLATFORM='x86_64'
DOCKER_PLATFORM='amd64'
fi
if [[ "$PLATFORM" == 'aarch64' || "$PLATFORM" == 'arm64' ]]; then
CABAL_PLATFORM='aarch64'
DOCKER_PLATFORM='arm64'
fi
export CABAL_PLATFORM DOCKER_PLATFORM
# copied from images.go
HASURA_GRAPHQL_ENGINE_SERVER_BUILDER_SHA="$(
sha256sum ../../.buildkite/dockerfiles/ci-builders/server-builder.dockerfile \
| awk '{ print $1 }'
)"
export HASURA_GRAPHQL_ENGINE_SERVER_BUILDER_SHA
# copied from images.go
HASURA_GRAPHQL_ENGINE_SERVER_PYTEST_RUNNER_SHA="$(
cat \
../../.buildkite/dockerfiles/server-pytest-runner/Dockerfile \
./requirements.txt \
./package-lock.json \
./package.json \
./remote_schemas/nodejs/package.json \
| sha256sum \
| awk '{ print $1 }'
)"
export HASURA_GRAPHQL_ENGINE_SERVER_PYTEST_RUNNER_SHA
# Use the Azure SQL Edge image instead of the SQL Server image on arm64.
# The latter doesn't work yet.
if [[ "$(uname -m)" == 'arm64' ]]; then
export MSSQL_IMAGE='mcr.microsoft.com/azure-sql-edge'
fi
if [[ $# -gt 0 ]]; then
SERVER_TESTS_TO_RUN=("$@")
else
SERVER_TESTS_TO_RUN=('no-auth')
fi
echo '*** Building images ***'
# We rebuild the images because on arm64, we end up with an amd64 Python test
# runner. This won't actually be able to run HGE. Until we build an arm64 image
# on CI, we need to instead build it locally.
if [[ "$DOCKER_PLATFORM" == 'arm64' ]]; then
docker compose build
fi
echo
echo '*** Building HGE ***'
docker compose run --rm hge-build
for SERVER_TEST_TO_RUN in "${SERVER_TESTS_TO_RUN[@]}"; do
export SERVER_TEST_TO_RUN
echo
echo "*** Running test suite: ${SERVER_TEST_TO_RUN} ***"
docker compose rm -svf postgres citus sqlserver sqlserver-healthcheck # tear down databases beforehand
docker compose run --rm tests-py
done