Skip to content
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

Move API tests to this repo #1047

Merged
merged 66 commits into from
Feb 3, 2025
Merged
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
2659a1f
Improve local vespa script
farshidz Nov 21, 2024
13ae53f
Move integ tests
farshidz Nov 21, 2024
bf43d54
Fix GH actions to use new path
farshidz Nov 21, 2024
2849cc2
Fix imports
farshidz Nov 21, 2024
a6099e6
Break unit tests
farshidz Nov 21, 2024
e213f0e
Merge branch 'mainline' into farshid/restructure-tests
farshidz Nov 21, 2024
07402c3
temp changes
farshidz Nov 27, 2024
cb3ca13
Add CPU local marqo workflow and move API tests to this repo
farshidz Dec 11, 2024
7ec7c98
Remove most tests to simplify testing
farshidz Dec 11, 2024
3cce854
Merge branch 'mainline' into farshid/restructure-tests
farshidz Dec 11, 2024
8b8609d
Fix py-marqo install step
farshidz Dec 11, 2024
0df6a52
Fix start marqo call
farshidz Dec 12, 2024
fb8e2eb
Fix start vespa call path
farshidz Dec 13, 2024
beff0b0
Fix requirements path
farshidz Dec 13, 2024
026f366
Update outdated tests
farshidz Dec 13, 2024
46f356f
Add TESTING_CONFIGURATION env var
farshidz Dec 13, 2024
3383a54
Merge branch 'mainline' into farshid/restructure-tests
farshidz Dec 15, 2024
44b92e0
Add MARQO_API_TESTS_ROOT env var
farshidz Dec 15, 2024
2a9e397
Add MARQO_IMAGE_NAME
farshidz Dec 15, 2024
8a9533e
rm Marqo image
farshidz Dec 16, 2024
98bbdc0
Reduce wait
farshidz Dec 16, 2024
25e43b6
Add other tests
farshidz Dec 16, 2024
4ebfdd3
Remove concurrency limit, comment out create index tests
farshidz Dec 16, 2024
0ff997b
Add create index tests back
farshidz Dec 16, 2024
210d94b
Add back concurrency limit
farshidz Dec 16, 2024
e010232
Set working directory in step
farshidz Dec 18, 2024
74a53e0
Simplify run step
farshidz Dec 18, 2024
e48ed69
Fix Docker context path
farshidz Dec 18, 2024
ffe3032
Quiet docker build
farshidz Dec 18, 2024
0321ea7
Move some code into script files to reuse
farshidz Dec 19, 2024
655e7c1
Update CUDA docker test
farshidz Dec 19, 2024
b422ea4
Update CPU docker test
farshidz Dec 19, 2024
74033c7
Rename api-tests to api_tests
farshidz Dec 19, 2024
5dc1667
Update arm64 tests
farshidz Dec 19, 2024
f7b626a
Merge branch 'mainline' into farshid/restructure-tests
farshidz Dec 19, 2024
b9d4dad
Remove pull request runs
farshidz Dec 19, 2024
6bff651
Remove concurrency limit on CPU Docker
farshidz Dec 19, 2024
fe38c40
Fix integ tests workflow
farshidz Dec 19, 2024
dbf0894
Fix imports
farshidz Dec 19, 2024
790f41b
Remove unused script
farshidz Dec 19, 2024
db55b59
Test one assert for create index failing test
farshidz Dec 19, 2024
341272e
Split tests
farshidz Dec 20, 2024
6a72692
Change CPU local workflow back to run all tests
farshidz Dec 20, 2024
e6c375d
Use start_vespa.py script for unit tests
farshidz Jan 10, 2025
d17f9ca
Merge remote-tracking branch 'origin/mainline' into farshid/restructu…
farshidz Jan 10, 2025
70f8db3
Fix path
farshidz Jan 10, 2025
d774277
Fix imports
farshidz Jan 10, 2025
2e0f883
Upgrade Vespa version
farshidz Jan 14, 2025
2801dad
Add unit tests workflow
farshidz Jan 15, 2025
3fbceb0
Merge branch 'mainline' into farshid/restructure-tests
farshidz Jan 24, 2025
9c9b0bf
Merge branch 'mainline' into farshid/restructure-tests
farshidz Jan 28, 2025
cef8347
Add new API tests
farshidz Jan 28, 2025
ca468cf
Try Python 3.9
farshidz Jan 28, 2025
4c1ea34
Fix import
farshidz Jan 28, 2025
5b5c0f3
Move search filter unit tests
farshidz Jan 28, 2025
e48f3af
Run just tests/api_tests/test_create_index.py
farshidz Jan 28, 2025
88663ba
Remove concurrency, run all
farshidz Jan 28, 2025
875e0ce
Remove test create index
farshidz Jan 28, 2025
39e679e
Reset things back to normal
farshidz Jan 28, 2025
1734982
Merge branch 'mainline' into farshid/restructure-tests
farshidz Jan 31, 2025
c3dcfa5
Downgrade Vespa to match api tests repo version
farshidz Jan 31, 2025
f0eb4ee
Remove test add documents common
farshidz Feb 3, 2025
1d46667
Try with original requirements.txt
farshidz Feb 3, 2025
3d5509f
Set MARQO_INDEX_DEPLOYMENT_LOCK_TIMEOUT=0
farshidz Feb 3, 2025
79dc4b6
Set Vespa version back to latest, add MARQO_INDEX_DEPLOYMENT_LOCK_TIM…
farshidz Feb 3, 2025
1dae10e
Go back to minimal requirements.txt
farshidz Feb 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 25 additions & 48 deletions .github/workflows/arm64_docker_marqo.yml
Original file line number Diff line number Diff line change
@@ -10,22 +10,15 @@ on:
description: >
The "py-marqo" branch this test is running against.
This is optional. If left as the default value "mainline", we run the test based on the "mainline" branch of
py-marqo. Otherwise, the specified branch is tested. For example "li/test-xx". You can also use "marqo" and
py-marqo. Otherwise, the specified branch is tested. For example "prefix/test-xx". You can also use "marqo" and
it will use the latest pypi release.
api_tests_branch:
required: false
default: mainline
description: >
The "api-tests" branch this test is running against.
This is optional. If left as the default value "mainline", we run the api tests based at branch
"mainline". Otherwise, the specified branch is tested. For example "li/test-xx"
image_to_test:
image_identifier:
required: false
# This is the name of the docker image that is built by the build script:
default: marqo_docker_0
description: >
This is optional. If left as the default value "marqo_docker_0", the docker image built from this branch is tested.
Otherwise, the specified docker image is tested. For example "marqoai/marqo:test"
Otherwise, the specified Docker image is tested. For example "marqoai/marqo:test"
push:
branches:
- mainline
@@ -74,62 +67,46 @@ jobs:
name: Run ARM64 Docker Maqo API Tests
needs: Start-Runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner

environment: marqo-test-suite
defaults:
run:
working-directory: tests/api_tests/v1
environment: marqo-test-suite

steps:

- name: Checkout marqo repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python 3.9
run: |
run: |
apt-get -y update
apt-get -y install python3.9
apt-get -y install pip

- name: Install Dependencies
run: |
#pip install -r requirements.txt
pip install tox==3.26
pip install flake8

# TODO: linting here

- name: Checkout marqo-api-tests repo
uses: actions/checkout@v3
with:
repository: marqo-ai/marqo-api-tests
ref: ${{ github.event.inputs.api_tests_branch }}
run: pip install -r requirements.txt

- name: Set MQ_PY_MARQO_BRANCH variable
run: |
if [[ "${{ inputs.py_marqo_branch }}" == "marqo" ]]; then
echo "MQ_PY_MARQO_BRANCH=marqo" >> $GITHUB_ENV
elif [[ "${{ inputs.py_marqo_branch }}" == "" ]]; then
echo "MQ_PY_MARQO_BRANCH=git+https://github.com/marqo-ai/py-marqo.git@mainline" >> $GITHUB_ENV
else
echo "MQ_PY_MARQO_BRANCH=git+https://github.com/marqo-ai/py-marqo.git@${{ inputs.py_marqo_branch }}" >> $GITHUB_ENV
fi
- name: Install py-marqo
run: bash scripts/install_pymarqo.sh ${{ inputs.py_marqo_branch }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Set up Environment
run: |
# Set up conf file
echo 'export MARQO_API_TESTS_ROOT="${{ github.workspace }}"' >> conf


- name: Run Integration Tests - ARM64 Docker Marqo
run: |
export MQ_API_TEST_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
echo "$MQ_API_TEST_BRANCH"
CUSTOM_TEST_IMG="${{ github.event.inputs.image_to_test }}"
export MQ_API_TEST_IMG=${CUSTOM_TEST_IMG:-"marqo_docker_0"}
tox -e py3-docker_marqo

CUSTOM_TEST_IMG="${{ github.event.inputs.image_identifier }}"
export TESTING_CONFIGURATION=CPU_DOCKER_MARQO
export MARQO_API_TESTS_ROOT=$(pwd)
export MARQO_IMAGE_NAME=${CUSTOM_TEST_IMG:-"marqo_docker_0"}

bash scripts/build_marqo.sh $MARQO_IMAGE_NAME

bash scripts/start_docker_marqo.sh $MARQO_IMAGE_NAME

pytest tests/

Stop-Runner:
name: Stop self-hosted EC2 runner
needs:
81 changes: 26 additions & 55 deletions .github/workflows/cpu_docker_marqo.yml
Original file line number Diff line number Diff line change
@@ -11,22 +11,15 @@ on:
description: >
The "py-marqo" branch this test is running against.
This is optional. If left as the default value "mainline", we run the test based on the "mainline" branch of
py-marqo. Otherwise, the specified branch is tested. For example "li/test-xx". You can also use "marqo" and
py-marqo. Otherwise, the specified branch is tested. For example "prefix/test-xx". You can also use "marqo" and
it will use the latest pypi release.
api_tests_branch:
required: false
default: mainline
description: >
The "api-tests" branch this test is running against.
This is optional. If left as the default value "mainline", we run the api tests based at branch
"mainline". Otherwise, the specified branch is tested. For example "li/test-xx"
image_to_test:
image_identifier:
required: false
# This is the name of the docker image that is built by the build script:
default: marqo_docker_0
description: >
This is optional. If left as the default value "marqo_docker_0", the docker image built from this branch is tested.
Otherwise, the specified docker image is tested. For example "marqoai/marqo:test"
Otherwise, the specified Docker image is tested. For example "marqoai/marqo:test"
push:
branches:
- mainline
@@ -37,10 +30,6 @@ on:
permissions:
contents: read

concurrency:
group: cpu-docker-api-tests-${{ github.ref }}
cancel-in-progress: true

jobs:
Start-Runner:
name: Start self-hosted EC2 runner
@@ -79,62 +68,44 @@ jobs:
name: Run CPU Docker Marqo API Tests
needs: Start-Runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner

environment: marqo-test-suite
defaults:
run:
working-directory: tests/api_tests/v1
environment: marqo-test-suite

steps:
- name: Checkout marqo repo

- name: Checkout Marqo repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
cache: "pip"

- name: Install Dependencies
run: |
#pip install -r requirements.txt
pip install tox==3.26
pip install flake8

# linting here
run: pip install -r requirements.txt

- name: Install py-marqo
run: bash scripts/install_pymarqo.sh ${{ inputs.py_marqo_branch }}

- name: Set MQ_PY_MARQO_BRANCH variable
run: |
if [[ "${{ inputs.py_marqo_branch }}" == "marqo" ]]; then
echo "MQ_PY_MARQO_BRANCH=marqo" >> $GITHUB_ENV
elif [[ "${{ inputs.py_marqo_branch }}" == "" ]]; then
echo "MQ_PY_MARQO_BRANCH=git+https://github.com/marqo-ai/py-marqo.git@mainline" >> $GITHUB_ENV
else
echo "MQ_PY_MARQO_BRANCH=git+https://github.com/marqo-ai/py-marqo.git@${{ inputs.py_marqo_branch }}" >> $GITHUB_ENV
fi

- name: Checkout marqo-api-tests repo
uses: actions/checkout@v3
with:
repository: marqo-ai/marqo-api-tests
ref: ${{ github.event.inputs.api_tests_branch }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Set up Environment
run: |
# Set up conf file
echo 'export MARQO_API_TESTS_ROOT="${{ github.workspace }}"' >> conf


- name: Run Integration Tests - CPU Docker Marqo
run: |
export MQ_API_TEST_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
echo "$MQ_API_TEST_BRANCH"
CUSTOM_TEST_IMG="${{ github.event.inputs.image_to_test }}"
export MQ_API_TEST_IMG=${CUSTOM_TEST_IMG:-"marqo_docker_0"}
tox -e py3-docker_marqo

CUSTOM_TEST_IMG="${{ github.event.inputs.image_identifier }}"
export TESTING_CONFIGURATION=CPU_DOCKER_MARQO
export MARQO_API_TESTS_ROOT=$(pwd)
export MARQO_IMAGE_NAME=${CUSTOM_TEST_IMG:-"marqo_docker_0"}

bash scripts/build_marqo.sh $MARQO_IMAGE_NAME

bash scripts/start_docker_marqo.sh $MARQO_IMAGE_NAME

pytest tests/

Stop-Runner:
name: Stop self-hosted EC2 runner
needs:
83 changes: 30 additions & 53 deletions .github/workflows/cpu_local_marqo.yml
Original file line number Diff line number Diff line change
@@ -11,22 +11,15 @@ on:
description: >
The "py-marqo" branch this test is running against.
This is optional. If left as the default value "mainline", we run the test based on the "mainline" branch of
py-marqo. Otherwise, the specified branch is tested. For example "li/test-xx". You can also use "marqo" and
py-marqo. Otherwise, the specified branch is tested. For example "prefix/test-xx". You can also use "marqo" and
it will use the latest pypi release.
api_tests_branch:
required: false
default: mainline
description: >
The "api-tests" branch this test is running against.
This is optional. If left as the default value "mainline", we run the api tests based at branch
"mainline". Otherwise, the specified branch is tested. For example "li/test-xx"
image_to_test:
image_identifier:
required: false
# This is the name of the docker image that is built by the build script:
default: marqo_docker_0
description: >
This is optional. If left as the default value "marqo_docker_0", the docker image built from this branch is tested.
Otherwise, the specified docker image is tested. For example "marqoai/marqo:test"
Otherwise, the specified Docker image is tested. For example "marqoai/marqo:test"
push:
branches:
- mainline
@@ -43,9 +36,9 @@ on:
permissions:
contents: read

concurrency:
group: cpu-local-api-tests-${{ github.ref }}
cancel-in-progress: true
#concurrency:
# group: cpu-local-api-tests-${{ github.ref }}
# cancel-in-progress: true

jobs:
Start-Runner:
@@ -85,60 +78,44 @@ jobs:
name: Run CPU Local Marqo API Tests
needs: Start-Runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner

environment: marqo-test-suite

defaults:
run:
working-directory: tests/api_tests/v1
environment: marqo-test-suite

steps:
- name: Checkout marqo repo

- name: Checkout Marqo repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
cache: "pip"

- name: Install Dependencies
run: |
#pip install -r requirements.txt
pip install tox==3.26
pip install flake8
run: pip install -r requirements.txt

- name: Install py-marqo
run: bash scripts/install_pymarqo.sh ${{ inputs.py_marqo_branch }}

- name: Set MQ_PY_MARQO_BRANCH variable
run: |
if [[ "${{ inputs.py_marqo_branch }}" == "marqo" ]]; then
echo "MQ_PY_MARQO_BRANCH=marqo" >> $GITHUB_ENV
elif [[ "${{ inputs.py_marqo_branch }}" == "" ]]; then
echo "MQ_PY_MARQO_BRANCH=git+https://github.com/marqo-ai/py-marqo.git@mainline" >> $GITHUB_ENV
else
echo "MQ_PY_MARQO_BRANCH=git+https://github.com/marqo-ai/py-marqo.git@${{ inputs.py_marqo_branch }}" >> $GITHUB_ENV
fi

- name: Checkout marqo-api-tests repo
uses: actions/checkout@v3
with:
repository: marqo-ai/marqo-api-tests
ref: ${{ github.event.inputs.api_tests_branch }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Set up Environment
run: |
# Set up conf file
echo 'export MARQO_API_TESTS_ROOT="${{ github.workspace }}"' >> conf


- name: Run Integration Tests - CPU Local Marqo
run: |
export MQ_API_TEST_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
echo "$MQ_API_TEST_BRANCH"
CUSTOM_TEST_IMG="${{ github.event.inputs.image_to_test }}"
export MQ_API_TEST_IMG=${CUSTOM_TEST_IMG:-"marqo_docker_0"}
tox -e py3-local_marqo

CUSTOM_TEST_IMG="${{ github.event.inputs.image_identifier }}"
export TESTING_CONFIGURATION=CPU_LOCAL_MARQO
export MARQO_API_TESTS_ROOT=$(pwd)
export MARQO_IMAGE_NAME=${CUSTOM_TEST_IMG:-"marqo_docker_0"}

bash scripts/build_marqo.sh $MARQO_IMAGE_NAME

bash scripts/start_local_marqo.sh $MARQO_IMAGE_NAME

pytest tests/

Stop-Runner:
name: Stop self-hosted EC2 runner
needs:
Loading