revert
pull/24414/head
Shane Smiskol 3 years ago
parent da5eb5c5ae
commit 22f8c5c994
  1. 304
      .github/workflows/selfdrive_tests.yaml
  2. 4
      selfdrive/test/process_replay/test_processes.py
  3. 5
      selfdrive/test/process_replay/update_refs.py

@ -228,60 +228,60 @@ jobs:
if: always() if: always()
run: cat selfdrive/test/valgrind_logs.txt run: cat selfdrive/test/valgrind_logs.txt
unit_tests: # unit_tests:
name: unit tests # name: unit tests
runs-on: ubuntu-20.04 # runs-on: ubuntu-20.04
timeout-minutes: 50 # timeout-minutes: 50
steps: # steps:
- name: Get current date # - name: Get current date
id: date # id: date
run: echo "::set-output name=time::$(date +'%s')" # run: echo "::set-output name=time::$(date +'%s')"
- name: Output timestamp # - name: Output timestamp
run: echo $TIMESTAMP # run: echo $TIMESTAMP
env: # env:
TIMESTAMP: ${{ steps.date.outputs.time }} # TIMESTAMP: ${{ steps.date.outputs.time }}
- uses: actions/checkout@v2 # - uses: actions/checkout@v2
with: # with:
submodules: true # submodules: true
- name: Cache scons # - name: Cache scons
id: scons-cache # id: scons-cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. # # TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged.
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b # uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
env: # env:
CACHE_SKIP_SAVE: ${{ github.ref != 'refs/heads/master' || github.repository != 'commaai/openpilot' }} # CACHE_SKIP_SAVE: ${{ github.ref != 'refs/heads/master' || github.repository != 'commaai/openpilot' }}
with: # with:
path: /tmp/scons_cache # path: /tmp/scons_cache
key: scons-${{ hashFiles('.github/workflows/selfdrive_tests.yaml') }}-${{ steps.date.outputs.time }} # key: scons-${{ hashFiles('.github/workflows/selfdrive_tests.yaml') }}-${{ steps.date.outputs.time }}
restore-keys: scons-${{ hashFiles('.github/workflows/selfdrive_tests.yaml') }}- # restore-keys: scons-${{ hashFiles('.github/workflows/selfdrive_tests.yaml') }}-
- name: Build Docker image # - name: Build Docker image
run: eval "$BUILD" # run: eval "$BUILD"
- name: Run unit tests # - name: Run unit tests
run: | # run: |
${{ env.RUN }} "export SKIP_LONG_TESTS=1 && \ # ${{ env.RUN }} "export SKIP_LONG_TESTS=1 && \
scons -j$(nproc) --test && \ # scons -j$(nproc) --test && \
$UNIT_TEST common && \ # $UNIT_TEST common && \
$UNIT_TEST opendbc/can && \ # $UNIT_TEST opendbc/can && \
$UNIT_TEST selfdrive/boardd && \ # $UNIT_TEST selfdrive/boardd && \
$UNIT_TEST selfdrive/controls && \ # $UNIT_TEST selfdrive/controls && \
$UNIT_TEST selfdrive/monitoring && \ # $UNIT_TEST selfdrive/monitoring && \
$UNIT_TEST selfdrive/loggerd && \ # $UNIT_TEST selfdrive/loggerd && \
$UNIT_TEST selfdrive/car && \ # $UNIT_TEST selfdrive/car && \
$UNIT_TEST selfdrive/locationd && \ # $UNIT_TEST selfdrive/locationd && \
$UNIT_TEST selfdrive/athena && \ # $UNIT_TEST selfdrive/athena && \
$UNIT_TEST selfdrive/thermald && \ # $UNIT_TEST selfdrive/thermald && \
$UNIT_TEST selfdrive/hardware/tici && \ # $UNIT_TEST selfdrive/hardware/tici && \
$UNIT_TEST selfdrive/modeld && \ # $UNIT_TEST selfdrive/modeld && \
$UNIT_TEST tools/lib/tests && \ # $UNIT_TEST tools/lib/tests && \
./selfdrive/boardd/tests/test_boardd_usbprotocol && \ # ./selfdrive/boardd/tests/test_boardd_usbprotocol && \
./selfdrive/common/tests/test_util && \ # ./selfdrive/common/tests/test_util && \
./selfdrive/common/tests/test_swaglog && \ # ./selfdrive/common/tests/test_swaglog && \
./selfdrive/loggerd/tests/test_logger &&\ # ./selfdrive/loggerd/tests/test_logger &&\
./selfdrive/proclogd/tests/test_proclog && \ # ./selfdrive/proclogd/tests/test_proclog && \
./selfdrive/ui/replay/tests/test_replay && \ # ./selfdrive/ui/replay/tests/test_replay && \
./selfdrive/camerad/test/ae_gray_test && \ # ./selfdrive/camerad/test/ae_gray_test && \
coverage xml" # coverage xml"
- name: "Upload coverage to Codecov" # - name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2 # uses: codecov/codecov-action@v2
process_replay: process_replay:
name: process replay name: process replay
@ -348,103 +348,103 @@ jobs:
# ${{ env.RUN }} "scons -j$(nproc) && \ # ${{ env.RUN }} "scons -j$(nproc) && \
# selfdrive/test/process_replay/model_replay.py" # selfdrive/test/process_replay/model_replay.py"
test_longitudinal: # test_longitudinal:
name: longitudinal # name: longitudinal
runs-on: ubuntu-20.04 # runs-on: ubuntu-20.04
timeout-minutes: 50 # timeout-minutes: 50
steps: # steps:
- uses: actions/checkout@v2 # - uses: actions/checkout@v2
with: # with:
submodules: true # submodules: true
- name: Cache scons # - name: Cache scons
id: scons-cache # id: scons-cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. # # TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged.
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b # uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
env: # env:
CACHE_SKIP_SAVE: true # CACHE_SKIP_SAVE: true
with: # with:
path: /tmp/scons_cache # path: /tmp/scons_cache
key: scons-${{ hashFiles('.github/workflows/selfdrive_tests.yaml') }}- # key: scons-${{ hashFiles('.github/workflows/selfdrive_tests.yaml') }}-
restore-keys: | # restore-keys: |
scons-${{ hashFiles('.github/workflows/selfdrive_tests.yaml') }}- # scons-${{ hashFiles('.github/workflows/selfdrive_tests.yaml') }}-
scons- # scons-
- name: Build Docker image # - name: Build Docker image
run: eval "$BUILD" # run: eval "$BUILD"
- name: Test longitudinal # - name: Test longitudinal
run: | # run: |
${{ env.RUN }} "mkdir -p selfdrive/test/out && \ # ${{ env.RUN }} "mkdir -p selfdrive/test/out && \
scons -j$(nproc) && \ # scons -j$(nproc) && \
cd selfdrive/test/longitudinal_maneuvers && \ # cd selfdrive/test/longitudinal_maneuvers && \
coverage run ./test_longitudinal.py && \ # coverage run ./test_longitudinal.py && \
coverage xml" # coverage xml"
- name: "Upload coverage to Codecov" # - name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2 # uses: codecov/codecov-action@v2
- uses: actions/upload-artifact@v2 # - uses: actions/upload-artifact@v2
if: always() # if: always()
continue-on-error: true # continue-on-error: true
with: # with:
name: longitudinal # name: longitudinal
path: selfdrive/test/longitudinal_maneuvers/out/longitudinal/ # path: selfdrive/test/longitudinal_maneuvers/out/longitudinal/
test_cars: # test_cars:
name: cars # name: cars
runs-on: ubuntu-20.04 # runs-on: ubuntu-20.04
timeout-minutes: 50 # timeout-minutes: 50
strategy: # strategy:
fail-fast: false # fail-fast: false
matrix: # matrix:
job: [0, 1, 2, 3] # job: [0, 1, 2, 3]
steps: # steps:
- uses: actions/checkout@v2 # - uses: actions/checkout@v2
with: # with:
submodules: true # submodules: true
- name: Cache dependencies # - name: Cache dependencies
id: dependency-cache # id: dependency-cache
uses: actions/cache@v2 # uses: actions/cache@v2
with: # with:
path: /tmp/comma_download_cache # path: /tmp/comma_download_cache
key: car_models-${{ hashFiles('selfdrive/car/tests/test_models.py', 'selfdrive/car/tests/routes.py') }}-${{ matrix.job }} # key: car_models-${{ hashFiles('selfdrive/car/tests/test_models.py', 'selfdrive/car/tests/routes.py') }}-${{ matrix.job }}
- name: Cache scons # - name: Cache scons
id: scons-cache # id: scons-cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. # # TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged.
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b # uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
env: # env:
CACHE_SKIP_SAVE: true # CACHE_SKIP_SAVE: true
with: # with:
path: /tmp/scons_cache # path: /tmp/scons_cache
key: scons-${{ hashFiles('.github/workflows/selfdrive_tests.yaml') }}- # key: scons-${{ hashFiles('.github/workflows/selfdrive_tests.yaml') }}-
restore-keys: | # restore-keys: |
scons-${{ hashFiles('.github/workflows/selfdrive_tests.yaml') }}- # scons-${{ hashFiles('.github/workflows/selfdrive_tests.yaml') }}-
scons- # scons-
- name: Build Docker image # - name: Build Docker image
run: eval "$BUILD" # run: eval "$BUILD"
- name: Test car models # - name: Test car models
run: | # run: |
${{ env.RUN }} "scons -j$(nproc) --test && \ # ${{ env.RUN }} "scons -j$(nproc) --test && \
FILEREADER_CACHE=1 coverage run -m pytest selfdrive/car/tests/test_models.py && \ # FILEREADER_CACHE=1 coverage run -m pytest selfdrive/car/tests/test_models.py && \
coverage xml && \ # coverage xml && \
chmod -R 777 /tmp/comma_download_cache" # chmod -R 777 /tmp/comma_download_cache"
env: # env:
NUM_JOBS: 4 # NUM_JOBS: 4
JOB_ID: ${{ matrix.job }} # JOB_ID: ${{ matrix.job }}
- name: "Upload coverage to Codecov" # - name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2 # uses: codecov/codecov-action@v2
docs: # docs:
name: build docs # name: build docs
runs-on: ubuntu-20.04 # runs-on: ubuntu-20.04
timeout-minutes: 50 # timeout-minutes: 50
steps: # steps:
- uses: actions/checkout@v2 # - uses: actions/checkout@v2
with: # with:
submodules: true # submodules: true
- name: Build docker container # - name: Build docker container
run: | # run: |
docker pull $DOCKER_REGISTRY/$BASE_IMAGE:latest || true # docker pull $DOCKER_REGISTRY/$BASE_IMAGE:latest || true
docker pull $DOCKER_REGISTRY/openpilot-docs:latest || true # docker pull $DOCKER_REGISTRY/openpilot-docs:latest || true
DOCKER_BUILDKIT=1 docker build --cache-from $DOCKER_REGISTRY/openpilot-docs:latest -t $DOCKER_REGISTRY/openpilot-docs:latest -f docs/docker/Dockerfile . # DOCKER_BUILDKIT=1 docker build --cache-from $DOCKER_REGISTRY/openpilot-docs:latest -t $DOCKER_REGISTRY/openpilot-docs:latest -f docs/docker/Dockerfile .
- name: Push docker container # - name: Push docker container
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/openpilot' # if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/openpilot'
run: | # run: |
$DOCKER_LOGIN # $DOCKER_LOGIN
docker push $DOCKER_REGISTRY/openpilot-docs:latest # docker push $DOCKER_REGISTRY/openpilot-docs:latest

@ -169,6 +169,10 @@ if __name__ == "__main__":
continue continue
cmp_log_fn = os.path.join(process_replay_dir, f"{segment}_{cfg.proc_name}_{ref_commit}.bz2") cmp_log_fn = os.path.join(process_replay_dir, f"{segment}_{cfg.proc_name}_{ref_commit}.bz2")
with open(cmp_log_fn, 'a') as f:
f.write('test file')
print('created temp file at {}'.format(cmp_log_fn))
sys.exit(1)
results[segment][cfg.proc_name] = test_process(cfg, lr, cmp_log_fn, args.ignore_fields, args.ignore_msgs, args.save_logs) results[segment][cfg.proc_name] = test_process(cfg, lr, cmp_log_fn, args.ignore_fields, args.ignore_msgs, args.save_logs)
diff1, diff2, failed = format_diff(results, ref_commit) diff1, diff2, failed = format_diff(results, ref_commit)

@ -1,6 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse import argparse
import os import os
import sys
from selfdrive.test.openpilotci import upload_file, get_url from selfdrive.test.openpilotci import upload_file, get_url
from selfdrive.test.process_replay.compare_logs import save_log from selfdrive.test.process_replay.compare_logs import save_log
@ -26,6 +27,10 @@ if __name__ == "__main__":
with open(ref_commit_fn, "w") as f: with open(ref_commit_fn, "w") as f:
f.write(ref_commit) f.write(ref_commit)
print('listing dir at: {}'.format(process_replay_dir))
print(os.listdir(process_replay_dir))
sys.exit(1)
for car_brand, segment in segments: for car_brand, segment in segments:
if args.only_upload: if args.only_upload:
for cfg in CONFIGS: for cfg in CONFIGS:

Loading…
Cancel
Save