Skip to content

Commit

Permalink
[#142]: Add das-cli to load the database instead of docker-compose (#154
Browse files Browse the repository at this point in the history
)

* das-serverless-functions-142: Use das-cli for integration test

* das-serverless-functions-142: Setup env on pipeline and run the integration tests

* das-serverless-functions: Update content to base64

* das-serverless-functions-142: Update dotenv

* das-serverless-functions-142: export .env
  • Loading branch information
levisingularity authored Sep 30, 2024
1 parent b353d07 commit 137cfde
Showing 1 changed file with 54 additions and 2 deletions.
56 changes: 54 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ jobs:
- name: Generate Coverage Report
run: make unit-tests-coverage

integration-tests:
build-and-integration-test:
if: ${{ github.ref_name != 'master' }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
Expand All @@ -97,7 +98,58 @@ jobs:
run: pip3 install -r das-query-engine/requirements.txt

- name: Set dotenv
run: cp .env.example .env
run: echo ${{ secrets.LOCAL_ENV }} | base64 -d > .env

- name: Perform Integration Testing
run: make integration-tests

integration-test-with-latest-image:
if: ${{ github.ref_name == 'master' }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ^3.10
cache: "pip"

- name: Install dependencies
run: pip3 install -r das-query-engine/requirements.txt

- name: Set dotenv
run: echo ${{ secrets.LATEST_IMAGE_ENV }} | base64 -d > .env

- name: Install das-cli
run: |
sudo bash -c "wget -O - http://45.77.4.33/apt-repo/setup.sh | bash"
sudo apt install das-cli
- name: Setup das-cli
run: |
export $(xargs < .env)
das-cli config set <<EOF
${DAS_REDIS_PORT}
n
${DAS_MONGODB_PORT}
${DAS_DATABASE_USERNAME}
${DAS_DATABASE_PASSWORD}
n
8888
EOF
das-cli config list
- name: Start das-cli database
run: das-cli db start

- name: Load metta data
run: das-cli metta load $(pwd)/examples/data/animals.metta

- name: Perform Integration Testing
run: |
export $(xargs < .env)
python3 -m pytest -sx -vv das-query-engine/tests/integration

0 comments on commit 137cfde

Please sign in to comment.