Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
martis42 committed Jan 7, 2024
1 parent a3ef1aa commit 7af494c
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 23 deletions.
82 changes: 61 additions & 21 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,39 +40,79 @@ jobs:
bazel build //...
integration-tests-aspect:
runs-on: ubuntu-22.04
strategy:
matrix:
os: [ ubuntu-22.04, macos-12, windows-2022 ]
runs-on: ${{ matrix.os }}
needs: [ fast-tests ]
steps:
- uses: actions/checkout@v4
- name: Integration tests - Aspect
run: |
cd test/aspect
./execute_tests.py
cd test
cd aspect
python execute_tests.py
# - name: Integration tests - Aspect
# if: runner.os == 'Linux' || runner.os == 'macOS'
# run: |
# cd test/aspect
# ./execute_tests.py
# - name: Integration tests - Aspect
# if: runner.os == 'Windows'
# run: |
# cd test\aspect
# python execute_tests.py

integration-tests-apply-fixes:
runs-on: ubuntu-22.04
strategy:
matrix:
os: [ ubuntu-22.04, macos-12 ]
runs-on: ${{ matrix.os }}
needs: [ fast-tests ]
steps:
- run: |
mkdir --parents /tmp/bin
- uses: actions/checkout@v4
- name: Prepare buildozer
if: runner.os == 'Linux'
run: |
mkdir -p /tmp/bin
wget --no-verbose https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildozer-linux-amd64 -O /tmp/bin/buildozer
chmod +x /tmp/bin/buildozer
- uses: actions/checkout@v4
- name: Prepare buildozer
if: runner.os == 'macOS'
run: |
mkdir -p /tmp/bin
wget --no-verbose https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildozer-darwin-amd64 -O /tmp/bin/buildozer
chmod +x /tmp/bin/buildozer
- name: Prepare buildozer
if: runner.os == 'Windows'
run: |
Invoke-WebRequest -Uri "https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildozer-windows-amd64.exe" -OutFile "D:\Downloads\buildozer.exe"
- name: Integration tests - Applying fixes
if: runner.os == 'Linux' || runner.os == 'macOS'
run: |
export PATH=/tmp/bin:$PATH
./test/apply_fixes/execute_tests.py
integration-tests-examples:
runs-on: ubuntu-22.04
needs: [ fast-tests ]
steps:
- uses: actions/checkout@v4
- name: Integration tests - Examples
run: |
cd examples
./test.py
- name: Integration tests - Examples with legacy WORKSPACE setup
./test/apply_fixes/execute_tests.py -v
- name: Integration tests - Applying fixes
if: runner.os == 'Windows'
run: |
cd examples
./test.py --legacy-workspace
env:Path += ';D:\Downloads'
python test/apply_fixes/execute_tests.py -v
# Works, but commented to ave resources
# integration-tests-examples:
# strategy:
# matrix:
# os: [ ubuntu-22.04, macos-12, windows-2022 ]
# runs-on: ${{ matrix.os }}
# needs: [ fast-tests ]
# steps:
# - uses: actions/checkout@v4
# - name: Integration tests - Examples
# run: |
# cd examples
# python test.py
# - name: Integration tests - Examples with legacy WORKSPACE setup
# run: |
# cd examples
# python test.py --legacy-workspace
3 changes: 1 addition & 2 deletions test/aspect/execution_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import logging
import subprocess
from importlib.machinery import SourceFileLoader
from os import environ
from pathlib import Path

from result import Error
Expand Down Expand Up @@ -72,7 +71,7 @@ def main(
versions = [TestedVersions(bazel=bazel, python=python)] if bazel and python else tested_versions

failed_tests = []
output_root = Path(environ["HOME"]) / ".cache" / "bazel" / workspace_path.relative_to("/")
output_root = Path.home() / ".cache" / "bazel" / workspace_path.relative_to(Path.home())
for version in versions:
output_base = output_root / f"aspect_integration_tests_bazel_{version.bazel}_python_{version.python}"
output_base.mkdir(parents=True, exist_ok=True)
Expand Down

0 comments on commit 7af494c

Please sign in to comment.