Skip to content
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
22 changes: 18 additions & 4 deletions .github/workflows/plugin_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ jobs:
update-environment: false
- name: Check out code
uses: actions/checkout@v5
- name: Determine Please version
if: ${{ inputs.platform != 'freebsd_amd64' }}
id: please_version
run: echo "version=$(./pleasew --version | awk '{print $NF}')" >> "$GITHUB_OUTPUT"
- name: Cache Please downloads
# The FreeBSD tests run inside a nested VM, so the host's cache directory isn't visible to them.
if: ${{ inputs.platform != 'freebsd_amd64' }}
uses: actions/cache@v4
with:
path: ~/.cache/please
key: please-${{ inputs.platform }}-${{ steps.please_version.outputs.version }}-${{ hashFiles('plugins/BUILD', 'third_party/**/BUILD') }}
restore-keys: |
please-${{ inputs.platform }}-${{ steps.please_version.outputs.version }}-
please-${{ inputs.platform }}-
- name: Configure plugin to use please_pex tool built from source
if: inputs.please_pex_from_repo
# PexTool can't be set to //tools/please_pex for e2e tests because it can't be built inside the e2e test
Expand All @@ -58,18 +72,18 @@ jobs:
_external_interpreter="python${{ inputs.python }}"
_in_repo_interpreter="//third_party/cc/cpython:cpython_${{ inputs.python }}|python"
echo "*** Running tests using external Python interpreter: $_external_interpreter"
./pleasew -o "plugin.python.defaultinterpreter:$_external_interpreter" test --rerun --keep_going --log_file plz-out/log/test-external_interpreter.log ${{ inputs.test_targets }}
./pleasew -o "plugin.python.defaultinterpreter:$_external_interpreter" test --profile ci --keep_going --log_file plz-out/log/test-external_interpreter.log ${{ inputs.test_targets }}
echo "*** Running tests using in-repo Python interpreter: $_in_repo_interpreter"
./pleasew -o "plugin.python.defaultinterpreter:$_in_repo_interpreter" test --rerun --keep_going --log_file plz-out/log/test-in_repo_interpreter.log ${{ inputs.test_targets }}
./pleasew -o "plugin.python.defaultinterpreter:$_in_repo_interpreter" test --profile ci --keep_going --log_file plz-out/log/test-in_repo_interpreter.log ${{ inputs.test_targets }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If --rerun is removed here, is there a risk that the tests always pass on this invocation (because they passed on the previous one)? I think changing the value of CONFIG.PYTHON.DEFAULT_INTERPRETER ought to invalidate the cached results, but there must have been a reason I added --rerun here...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah I wasn't sure what it was for - we shouldn't need that ideally. Changing the interpreter will be an input to the test so it would force it to rerun anyway

- name: Run tests (on host)
if: ${{ inputs.platform != 'freebsd_amd64' }}
run: |
_external_interpreter="${{ steps.python.outputs.python-path }}"
_in_repo_interpreter="//third_party/cc/cpython:cpython_${{ inputs.python }}|python"
echo "*** Running tests using external Python interpreter: $_external_interpreter"
./pleasew -o "plugin.python.defaultinterpreter:$_external_interpreter" test --rerun --keep_going --log_file plz-out/log/test-external_interpreter.log ${{ inputs.test_targets }}
./pleasew -o "plugin.python.defaultinterpreter:$_external_interpreter" test --profile ci --keep_going --log_file plz-out/log/test-external_interpreter.log ${{ inputs.test_targets }}
echo "*** Running tests using in-repo Python interpreter: $_in_repo_interpreter"
./pleasew -o "plugin.python.defaultinterpreter:$_in_repo_interpreter" test --rerun --keep_going --log_file plz-out/log/test-in_repo_interpreter.log ${{ inputs.test_targets }}
./pleasew -o "plugin.python.defaultinterpreter:$_in_repo_interpreter" test --profile ci --keep_going --log_file plz-out/log/test-in_repo_interpreter.log ${{ inputs.test_targets }}
- name: Archive logs
uses: actions/upload-artifact@v7
with:
Expand Down
3 changes: 3 additions & 0 deletions .plzconfig.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[cache]
dircompress = true
dirclean = false
Loading