diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b051f40c..3dcd6ee0 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,4 +1,4 @@ -name: Run Tests +name: Run Tests on Production Environment on: push: @@ -25,8 +25,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install . - pip install pytest + pip install ".[test]" - name: Set environment variables run: | echo "TEAM_API_KEY=${{ secrets.TEAM_API_KEY_PROD }}" >> $GITHUB_ENV @@ -34,29 +33,42 @@ jobs: echo "MODELS_RUN_URL=https://models.aixplain.com/api/v1/execute" >> $GITHUB_ENV echo "PIPELINES_RUN_URL=https://platform-api.aixplain.com/assets/pipeline/execution/run" >> $GITHUB_ENV - - name: Run general_assets + - name: Run Unit Tests + continue-on-error: true + run: python -m pytest tests/unit + + - name: Run General Assets + continue-on-error: true run: python -m pytest tests/functional/general_assets - name: Run File Asset + continue-on-error: true run: python -m pytest tests/functional/file_asset - name: Run Agent + continue-on-error: true run: python -m pytest tests/functional/agent - name: Run Team Agent + continue-on-error: true run: python -m pytest tests/functional/team_agent - name: Run Data + continue-on-error: true run: python -m pytest tests/functional/data_asset - - name: Run Becnhmark + - name: Run Benchmark + continue-on-error: true run: python -m pytest tests/functional/benchmark - name: Run Pipelines + continue-on-error: true run: python -m pytest tests/functional/pipelines - name: Run Api Key + continue-on-error: true run: python -m pytest tests/functional/apikey - name: Run Finetuner + continue-on-error: true run: python -m pytest tests/functional/finetune diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 62103a6e..2e5b8614 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,4 +1,4 @@ -name: Run Tests +name: Run Tests on Test Environment on: push: @@ -10,8 +10,9 @@ on: workflow_dispatch: jobs: - test-general-assets: + test: runs-on: ubuntu-latest + continue-on-error: true steps: - name: Checkout repository uses: actions/checkout@v4 @@ -24,239 +25,51 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install . - pip install pytest + pip install ".[test]" - name: Set environment variables run: | echo "TEAM_API_KEY=${{ secrets.TEAM_API_KEY }}" >> $GITHUB_ENV - echo "BACKEND_URL=https://test-platform-api.aixplain.com/" >> $GITHUB_ENV + echo "BACKEND_URL=https://test-platform-api.aixplain.com" >> $GITHUB_ENV echo "MODELS_RUN_URL=https://test-models.aixplain.com/api/v1/execute" >> $GITHUB_ENV echo "PIPELINES_RUN_URL=https://test-platform-api.aixplain.com/assets/pipeline/execution/run" >> $GITHUB_ENV - - name: Run general_assets - run: python -m pytest tests/functional/general_assets - - test-file-asset: - runs-on: ubuntu-latest - needs: test-general-assets - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.8" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install . - pip install pytest + - name: Run Unit Tests + continue-on-error: true + run: python -m pytest tests/unit - - name: Set environment variables - run: | - echo "TEAM_API_KEY=${{ secrets.TEAM_API_KEY }}" >> $GITHUB_ENV - echo "BACKEND_URL=https://test-platform-api.aixplain.com/" >> $GITHUB_ENV - echo "MODELS_RUN_URL=https://test-models.aixplain.com/api/v1/execute" >> $GITHUB_ENV - echo "PIPELINES_RUN_URL=https://test-platform-api.aixplain.com/assets/pipeline/execution/run" >> $GITHUB_ENV + - name: Run General Assets + continue-on-error: true + run: python -m pytest tests/functional/general_assets - name: Run File Asset + continue-on-error: true run: python -m pytest tests/functional/file_asset - test-agent: - runs-on: ubuntu-latest - needs: test-file-asset - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.8" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install . - pip install pytest - - - name: Set environment variables - run: | - echo "TEAM_API_KEY=${{ secrets.TEAM_API_KEY }}" >> $GITHUB_ENV - echo "BACKEND_URL=https://test-platform-api.aixplain.com/" >> $GITHUB_ENV - echo "MODELS_RUN_URL=https://test-models.aixplain.com/api/v1/execute" >> $GITHUB_ENV - echo "PIPELINES_RUN_URL=https://test-platform-api.aixplain.com/assets/pipeline/execution/run" >> $GITHUB_ENV - - name: Run Agent + continue-on-error: true run: python -m pytest tests/functional/agent - test-team-agent: - runs-on: ubuntu-latest - needs: test-agent - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.8" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install . - pip install pytest - - - name: Set environment variables - run: | - echo "TEAM_API_KEY=${{ secrets.TEAM_API_KEY }}" >> $GITHUB_ENV - echo "BACKEND_URL=https://test-platform-api.aixplain.com/" >> $GITHUB_ENV - echo "MODELS_RUN_URL=https://test-models.aixplain.com/api/v1/execute" >> $GITHUB_ENV - echo "PIPELINES_RUN_URL=https://test-platform-api.aixplain.com/assets/pipeline/execution/run" >> $GITHUB_ENV - - name: Run Team Agent + continue-on-error: true run: python -m pytest tests/functional/team_agent - test-data-asset: - runs-on: ubuntu-latest - needs: test-team-agent - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.8" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install . - pip install pytest - - - name: Set environment variables - run: | - echo "TEAM_API_KEY=${{ secrets.TEAM_API_KEY }}" >> $GITHUB_ENV - echo "BACKEND_URL=https://test-platform-api.aixplain.com/" >> $GITHUB_ENV - echo "MODELS_RUN_URL=https://test-models.aixplain.com/api/v1/execute" >> $GITHUB_ENV - echo "PIPELINES_RUN_URL=https://test-platform-api.aixplain.com/assets/pipeline/execution/run" >> $GITHUB_ENV - - name: Run Data + continue-on-error: true run: python -m pytest tests/functional/data_asset - test-benchmark: - runs-on: ubuntu-latest - needs: test-data-asset - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.8" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install . - pip install pytest - - - name: Set environment variables - run: | - echo "TEAM_API_KEY=${{ secrets.TEAM_API_KEY }}" >> $GITHUB_ENV - echo "BACKEND_URL=https://test-platform-api.aixplain.com/" >> $GITHUB_ENV - echo "MODELS_RUN_URL=https://test-models.aixplain.com/api/v1/execute" >> $GITHUB_ENV - echo "PIPELINES_RUN_URL=https://test-platform-api.aixplain.com/assets/pipeline/execution/run" >> $GITHUB_ENV - - name: Run Benchmark + continue-on-error: true run: python -m pytest tests/functional/benchmark - test-pipelines: - runs-on: ubuntu-latest - needs: test-benchmark - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.8" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install . - pip install pytest - - - name: Set environment variables - run: | - echo "TEAM_API_KEY=${{ secrets.TEAM_API_KEY }}" >> $GITHUB_ENV - echo "BACKEND_URL=https://test-platform-api.aixplain.com/" >> $GITHUB_ENV - echo "MODELS_RUN_URL=https://test-models.aixplain.com/api/v1/execute" >> $GITHUB_ENV - echo "PIPELINES_RUN_URL=https://test-platform-api.aixplain.com/assets/pipeline/execution/run" >> $GITHUB_ENV - - name: Run Pipelines + continue-on-error: true run: python -m pytest tests/functional/pipelines - test-api-key: - runs-on: ubuntu-latest - needs: test-pipelines - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.8" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install . - pip install pytest - - - name: Set environment variables - run: | - echo "TEAM_API_KEY=${{ secrets.TEAM_API_KEY }}" >> $GITHUB_ENV - echo "BACKEND_URL=https://test-platform-api.aixplain.com/" >> $GITHUB_ENV - echo "MODELS_RUN_URL=https://test-models.aixplain.com/api/v1/execute" >> $GITHUB_ENV - echo "PIPELINES_RUN_URL=https://test-platform-api.aixplain.com/assets/pipeline/execution/run" >> $GITHUB_ENV - - name: Run Api Key + continue-on-error: true run: python -m pytest tests/functional/apikey - test-finetuner: - runs-on: ubuntu-latest - needs: test-api-key - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.8" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install . - pip install pytest - - - name: Set environment variables - run: | - echo "TEAM_API_KEY=${{ secrets.TEAM_API_KEY }}" >> $GITHUB_ENV - echo "BACKEND_URL=https://test-platform-api.aixplain.com/" >> $GITHUB_ENV - echo "MODELS_RUN_URL=https://test-models.aixplain.com/api/v1/execute" >> $GITHUB_ENV - echo "PIPELINES_RUN_URL=https://test-platform-api.aixplain.com/assets/pipeline/execution/run" >> $GITHUB_ENV - - name: Run Finetuner - run: python -m pytest tests/functional/finetune + continue-on-error: true + run: python -m pytest tests/functional/finetune \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index a59e0e15..971f15d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,5 +69,6 @@ model-builder = [ test = [ "pytest>=6.1.0", "docker>=6.1.3", - "requests-mock>=1.11.0" + "requests-mock>=1.11.0", + "pytest-mock>=3.10.0" ]