Skip to content

Commit

Permalink
Add back UPB test coverage that was undone from test migration.
Browse files Browse the repository at this point in the history
I've been gradually moving the location of our UPB tests to make them "more
default" (see an example here:
a02ec0f)

It turns out that reduced some of our open-source coverage around UPB python
unit tests. In this commit, I temporarily hard-code the tests I've migrated,
and eventually I'll change it into a wildcard expansion to be more robust. We
can't do wildcards right now because not all tests in the
google.protobuf.internal namespace support UPB by default yet.

#test-continuous

PiperOrigin-RevId: 707564382
  • Loading branch information
tonyliaoss authored and copybara-github committed Dec 18, 2024
1 parent 1900cbe commit 81523f7
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/test_upb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,24 @@ jobs:
- name: Install Protobuf Test Wheel
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
run: pip install -vvv --no-index --find-links wheels protobuftests
- name: Run the unit tests
- name: Run legacy unit tests
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
# Legacy upb tests use a "test wrapper" and get installed under pb_unit_tests.
run: |
TESTS=$(pip show -f protobuftests | grep pb_unit_tests.*py$ | sed 's,/,.,g' | sed 's,\\,.,g' | sed -E 's,.py$,,g')
for test in $TESTS; do
PB_UNIT_TESTS=$(pip show -f protobuftests | grep pb_unit_tests.*py$ | sed 's,/,.,g' | sed 's,\\,.,g' | sed -E 's,.py$,,g')
for test in $PB_UNIT_TESTS; do
python -m unittest -v $test
done
- name: Run unit tests
if: ${{ !matrix.continuous-only || inputs.continuous-run }}
# Newer upb tests are in the standard google.protobuf.internal path.
# We will eventually make this into a wildcard rule once all tests
# have been migrated to be compatible with upb.
run: |
TESTS=(message_test message_factory_test descriptor_test proto_builder_test)
for test in ${TESTS[@]}; do
python -m unittest -v google.protobuf.internal.${test}
done
test_pure_python_wheels:
name: Test Pure Python Wheels
Expand Down

0 comments on commit 81523f7

Please sign in to comment.