Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL] Move SYCL header E2E checker test to compile-time #15835

Merged
merged 4 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/sycl-linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ jobs:
if: always() && !cancelled() && contains(inputs.changes, 'libdevice')
run: |
cmake --build $GITHUB_WORKSPACE/build --target check-libdevice
- name: Check E2E test requirements
if: always() && !cancelled() && !contains(inputs.changes, 'sycl')
run: |
# TODO consider moving this to Dockerfile.
export LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
LIT_OPTS="--allow-empty-runs" LIT_FILTER="e2e_test_requirements" cmake --build $GITHUB_WORKSPACE/build --target check-sycl
- name: Install
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
# TODO replace utility installation with a single CMake target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
// verify that against the reference
// - ...and check if the list of improperly XFAIL-ed tests needs to be updated.
//
// RUN: grep -rI "XFAIL:" %S/../test-e2e \
// RUN: grep -rI "XFAIL:" %S/../../test-e2e \
// RUN: -A 1 --include=*.c --include=*.cpp --no-group-separator | \
// RUN: grep -v "XFAIL:" | \
// RUN: grep -Pv "XFAIL-TRACKER:\s+(?:https://github.com/[\w\d-]+/[\w\d-]+/issues/[\d]+)|(?:[\w]+-[\d]+)" > %t | \
Copy link
Contributor Author

@sarnex sarnex Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it took me like 4 hours to find why this test was randomly failing, it's because we write to%t on disk and then immediately cat it after a pipe, seems sometimes we get a partially written/empty file. i don't know enough about bash to say specifically what part is async/buffered/whatever, but we can easily do something cleaner that works consistently

no need to pipe here, just use separate commands

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing that!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We used pipes before we added the output to the file, so yes we should have updated this when adding an output to the file.

Copy link
Contributor Author

@sarnex sarnex Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, this one was really insane to debug, i had to make the test infinite loop and connect to one of the CI machines so i could manually run the commands, i couldnt repro locally, probably because local system was too fast writing to disc?

// RUN: grep -Pv "XFAIL-TRACKER:\s+(?:https://github.com/[\w\d-]+/[\w\d-]+/issues/[\d]+)|(?:[\w]+-[\d]+)" > %t
// RUN: cat %t | wc -l | FileCheck %s --check-prefix NUMBER-OF-XFAIL-WITHOUT-TRACKER
// RUN: cat %t | sed 's/\.cpp.*/.cpp/' | sort | FileCheck %s
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// REQUIRES: linux
//
// RUN: grep -r -l 'sycl.hpp' %S | FileCheck %s
// RUN: grep -r -l 'sycl.hpp' %S | wc -l | FileCheck %s --check-prefix CHECK-NUM-MATCHES
// RUN: grep -r -l 'sycl.hpp' %S/../../test-e2e | FileCheck %s
// RUN: grep -r -l 'sycl.hpp' %S/../../test-e2e | wc -l | FileCheck %s --check-prefix CHECK-NUM-MATCHES
//
// CHECK-DAG: README.md
// CHECK-DAG: no_sycl_hpp_in_e2e_tests.cpp
// CHECK-DAG: lit.cfg.py
//
// CHECK-NUM-MATCHES: 5
// CHECK-NUM-MATCHES: 4
//
// This test verifies that `<sycl/sycl.hpp>` isn't used in E2E tests. Instead,
// fine-grained includes should used, see
Expand Down
Loading