diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5ecff775da..0f2fca481c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,4 +1,4 @@ -name: tests +name: Openpilot Tests on: [push, pull_request] env: @@ -65,6 +65,7 @@ jobs: name: process replay runs-on: ubuntu-16.04 needs: build + timeout-minutes: 30 steps: - uses: actions/download-artifact@v1 with: @@ -86,6 +87,7 @@ jobs: name: longitudinal runs-on: ubuntu-16.04 needs: build + timeout-minutes: 30 steps: - uses: actions/download-artifact@v1 with: @@ -108,6 +110,7 @@ jobs: name: test car models runs-on: ubuntu-16.04 needs: build + timeout-minutes: 30 steps: - uses: actions/download-artifact@v1 with: @@ -116,4 +119,3 @@ jobs: run: $LOAD - name: Test car models run: $RUN "mkdir -p /data/params && cd /tmp/openpilot/selfdrive/test/ && ./test_car_models.py" - diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 56e7a7461a..0000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,197 +0,0 @@ -pr: none - -variables: -- group: shared-variables - -jobs: -- job: build - pool: - vmImage: 'ubuntu-16.04' - steps: - - checkout: self - lfs: true - submodules: true - persistCredentials: true - - script: | - HEADER=$(git config http.https://github.com/commaai/one.extraheader) - - mkdir xx - cd xx - - git init - git remote add origin https://github.com/commaai/xx - git config gc.auto 0 - git lfs install --local - - git -c http.extraheader="$HEADER" fetch --force --tags --prune --progress --no-recurse-submodules origin - HASH=$(git rev-parse origin/master) - git -c http.https://github.com.extraheader="$HEADER" lfs fetch origin $HASH - git checkout --progress --force $HASH - displayName: Checkout xx - - script: | - until docker login commaregistry.azurecr.io -u commaregistry -p "${COMMAREGISTRY_PASSWORD}" - do - echo "Try again" - done - displayName: Registry login - env: - COMMAREGISTRY_PASSWORD: $(COMMAREGISTRY_PASSWORD) - - script: | - docker pull $(grep -ioP '(?<=^from)\s+\S+' Dockerfile.openpilot_ci) || true - docker pull commaregistry.azurecr.io/openpilot_ci:latest || true - docker build \ - --cache-from commaregistry.azurecr.io/openpilot_ci:latest \ - -t commaregistry.azurecr.io/openpilot_ci:latest \ - -t commaregistry.azurecr.io/openpilot_ci:${BUILD_SOURCEVERSION} \ - -f Dockerfile.openpilot_ci . - displayName: Docker build - - script: | - docker push commaregistry.azurecr.io/openpilot_ci:latest - docker push commaregistry.azurecr.io/openpilot_ci:${BUILD_SOURCEVERSION} - displayName: Docker push - -- job: linter - displayName: Linter - container: - image: commaregistry.azurecr.io/openpilot_ci:$(Build.SourceVersion) - endpoint: commaregistry - dependsOn: build - steps: - - checkout: none - - script: | - sudo -i -u root bash << EOF - set -e - export PATH=/root/.pyenv/bin:/root/.pyenv/shims:$PATH - export PYTHONPATH=/tmp/openpilot - - cd /tmp/openpilot - /tmp/openpilot/flake8_openpilot.sh - /tmp/openpilot/pylint_openpilot.sh - EOF - displayName: Linter - -- job: unittest - displayName: Unit Tests - container: - image: commaregistry.azurecr.io/openpilot_ci:$(Build.SourceVersion) - endpoint: commaregistry - dependsOn: linter - steps: - - checkout: none - - script: | - sudo -i -u root bash << EOF - set -e - - export PATH=/root/.pyenv/bin:/root/.pyenv/shims:/tmp/openpilot/external/bin:$PATH - export PYTHONPATH=/tmp/openpilot - - /tmp/openpilot/selfdrive/test/test_fingerprints.py - /tmp/openpilot/selfdrive/locationd/test/ci_test.py - - cd /tmp/openpilot - python -m unittest discover common - python -m unittest discover selfdrive/car - python -m unittest discover selfdrive/boardd - python -m unittest discover selfdrive/loggerd - python -m unittest discover selfdrive/controls - python -m unittest discover selfdrive/locationd - python -m unittest discover selfdrive/athena - - EOF - displayName: Unittests - -- job: quick_check - displayName: Test car models - container: - image: commaregistry.azurecr.io/openpilot_ci:$(Build.SourceVersion) - endpoint: commaregistry - options: --shm-size 1G - dependsOn: linter - steps: - - checkout: none - - script: | - sudo -i -u root bash << EOF - set -e - export PATH=/root/.pyenv/bin:/root/.pyenv/shims:/tmp/openpilot/external/bin:$PATH - export PYTHONPATH=/tmp/openpilot - export EXTERNAL=1 - export CI=1 - export AZUTIL_KEYS=/tmp/openpilot/selfdrive/test/commadataci.json - export UNLOGGER_PATH=xx/chffr/unlogger/unlogger.py - - mkdir -p /data/params - - cd /tmp/openpilot - /tmp/openpilot/selfdrive/test/test_car_models.py - EOF - -- job: longitudinal_test - displayName: Longitudinal Test - container: - image: commaregistry.azurecr.io/openpilot_ci:$(Build.SourceVersion) - endpoint: commaregistry - volumes: - - /tmp/out:/tmp/out - options: --shm-size 1G - dependsOn: linter - steps: - - checkout: none - - script: | - sudo -i -u root bash << EOF - set -e - export PATH=/root/.pyenv/bin:/root/.pyenv/shims:/tmp/openpilot/external/bin:$PATH - export PYTHONPATH=/tmp/openpilot - - cd /tmp/openpilot - /tmp/openpilot/selfdrive/test/longitudinal_maneuvers/test_longitudinal.py - cp -r /tmp/openpilot/out/longitudinal /tmp/out - EOF - - task: PublishBuildArtifacts@1 - inputs: - pathtoPublish: /tmp/out - artifactName: out - -- job: process_replay - displayName: Process Replay - container: - image: commaregistry.azurecr.io/openpilot_ci:$(Build.SourceVersion) - endpoint: commaregistry - volumes: - - /tmp/out:/tmp/out - options: --shm-size 1G - dependsOn: linter - steps: - - checkout: none - - script: | - sudo -i -u root bash << EOF - set -e - - export PATH=/root/.pyenv/bin:/root/.pyenv/shims:/tmp/openpilot/external/bin:$PATH - export PYTHONPATH=/tmp/openpilot - export PYTHONUNBUFFERED=1 - export CI=1 - - cd /tmp/openpilot - pip install coverage==4.5.4 - coverage run --branch --concurrency=thread -p /tmp/openpilot/selfdrive/test/process_replay/test_processes.py - coverage combine - coverage html -d /tmp/out/coverage - - EOF - displayName: Run replay - - script: | - sudo -i -u root bash << EOF - cp /tmp/openpilot/selfdrive/test/process_replay/diff.txt /tmp/out/diff.txt - EOF - condition: succeededOrFailed() - displayName: Copy diff - - task: PublishBuildArtifacts@1 - inputs: - pathtoPublish: /tmp/out/diff.txt - artifactName: diff.txt - condition: succeededOrFailed() - - task: PublishBuildArtifacts@1 - inputs: - pathtoPublish: /tmp/out/coverage - artifactName: coverage - condition: succeededOrFailed()