Skip to content

Commit

Permalink
Test mac tweaks to fix flaky failures and lag
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 508555693
  • Loading branch information
mkruskal-google authored and copybara-github committed Jun 26, 2023
1 parent 7564894 commit 46b625e
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 315 deletions.
151 changes: 5 additions & 146 deletions .github/workflows/test_php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,160 +12,17 @@ permissions:
contents: read

jobs:
linux:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
include:
- name: 7.3 Debug
version-short: "7.3"
version: 7.3.28-dbg
command: composer test \&\& composer test_c
- name: 7.4 Debug
version-short: "7.4"
version: 7.4.18-dbg
command: composer test \&\& composer test_c
- name: 8.0 Optimized
version: "8.0.5"
version-short: "8.0"
command: composer test \&\& composer test_c
- name: 8.0 Debug
version: 8.0.5-dbg
version-short: "8.0"
command: composer test \&\& composer test_c
- name: 8.0 Memory Leak
version: 8.0.5-dbg
version-short: "8.0"
# Run specialized memory leak & multirequest tests.
command: composer test_c \&\& tests/multirequest.sh \&\& tests/memory_leak_test.sh
- name: 8.0 Valgrind
version: 8.0.5-dbg
version-short: "8.0"
command: composer test_valgrind

name: Linux ${{ matrix.name}}
runs-on: ubuntu-latest
steps:
- name: Checkout pending changes
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ inputs.safe-checkout }}
submodules: recursive
- name: Setup composer
uses: protocolbuffers/protobuf-ci/composer-setup@v1
with:
cache-prefix: php-${{ matrix.version-short }}
directory: php
- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v1
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/php:${{ matrix.version }}-508417e5215994ade7585d28ba3aad681a25fa5d
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
extra-flags: -e COMPOSER_HOME=/workspace/composer-cache
command: ${{ matrix.command }}

linux-32bit:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
version: ['7.4', '8.0']
suffix: [ '', '-zts']
test: ['test', 'test_c']
exclude:
- suffix: '-zts'
test: 'test'
include:
- suffix: '-zts'
suffix_name: ' Thread Safe'
- test: 'test_c'
test_name: ' Extension'

name: Linux 32-bit ${{ matrix.version}}${{ matrix.suffix_name }}${{ matrix.test_name }}
runs-on: ubuntu-latest
env:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/32bit@sha256:97f50ab24582380012d7ddef5f82f08e19b9dff55d09a4a8d90a87421ae66a45
steps:
- name: Checkout pending changes
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ inputs.safe-checkout }}
submodules: recursive

- name: Cross compile protoc for i386
id: cross-compile
uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v1
with:
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:5.1.1-6361b3a6e5c97e9951d03a4de28542fc45f1adab
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
architecture: linux-i386

- name: Setup composer
uses: protocolbuffers/protobuf-ci/composer-setup@v1
with:
cache-prefix: php-${{ matrix.version }}
directory: php

- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v1
with:
image: ${{ env.image }}
skip-staleness-check: true
platform: linux/386
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
extra-flags: -e COMPOSER_HOME=/workspace/composer-cache -e PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }}
command: >-
/bin/bash -cex '
cd php && php -v && php -m;
composer update --ignore-platform-reqs;
PATH="/usr/local/php-${{ matrix.version }}${{matrix.suffix}}/bin:$PATH"
composer ${{ matrix.test }}'
linux-aarch64:
name: Linux aarch64
runs-on: ubuntu-latest
steps:
- name: Checkout pending changes
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ inputs.safe-checkout }}

- name: Cross compile protoc for aarch64
id: cross-compile
uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v1
with:
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:5.1.1-6361b3a6e5c97e9951d03a4de28542fc45f1adab
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
architecture: linux-aarch64

- name: Setup composer
uses: protocolbuffers/protobuf-ci/composer-setup@v1
with:
cache-prefix: php-7.3
directory: php

- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v1
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/php-aarch64:0cc100b6e03d14c1e8f71ae794dc162ed122fe31@sha256:77b70feba68dced1f0fd21b52a08d3d2e0c5c797bfe68435a0038ce87ecfd310
platform: linux/arm64
skip-staleness-check: true
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
extra-flags: -e COMPOSER_HOME=/workspace/composer-cache -e PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }}
command: >-
-c '
cd php;
composer update --ignore-platform-reqs;
composer test;
composer test_c'
macos:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
version: ['7.4', '8.0']
noop: [0,1,2,3,4,5]

name: MacOS PHP ${{ matrix.version }}
runs-on: macos-12
env:
BAZEL_OSX_EXECUTE_TIMEOUT: 60
steps:
- name: Checkout pending changes
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
Expand Down Expand Up @@ -198,6 +55,7 @@ jobs:
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: php_macos/${{ matrix.version }}
version: '6.1.0'
bash: |
pushd php
php -v
Expand All @@ -211,6 +69,7 @@ jobs:
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: php_macos/${{ matrix.version }}
version: '6.1.0'
bash: >-
bazelisk $BAZEL_STARTUP_FLAGS \
test $BAZEL_FLAGS \
Expand Down
42 changes: 5 additions & 37 deletions .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,14 @@ permissions:
contents: read

jobs:
linux:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
type: [ Pure, C++]
version: [ "3.7", "3.8", "3.9", "3.10" ]
include:
- type: Pure
targets: //python/... @upb//python/... //python:python_version
flags: --define=use_fast_cpp_protos=false
- type: C++
targets: //python/... //python:python_version
flags: --define=use_fast_cpp_protos=true
- type: C++
version: aarch64
targets: //python/... //python:aarch64_test
# TODO(b/262628111) Enable this once conformance tests are fixed.
flags: --define=use_fast_cpp_protos=true --test_tag_filters=-conformance
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:aarch64-3af05275178e16af30961976af126eabbbb2c733

name: Linux ${{ matrix.type }} ${{ matrix.version }}
runs-on: ubuntu-latest
steps:
- name: Checkout pending changes
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ inputs.safe-checkout }}
- name: Run tests
uses: protocolbuffers/protobuf-ci/bazel-docker@v1
with:
image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/python:{0}-508417e5215994ade7585d28ba3aad681a25fa5d', matrix.version) }}
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: python_linux/${{ matrix.type }}_${{ matrix.version }}
bazel: test ${{ matrix.targets }} ${{ matrix.flags }} --test_env=KOKORO_PYTHON_VERSION


macos:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
type: [ Pure, C++]
# TODO(b/267550843) Consider expanding this set of versions.
version: [ "3.10" ]
version: [ "3.7", "3.8", "3.9", "3.10" ]
noop: [0,1,2,3,4,5,6,7,8,9]
include:
- type: Pure
targets: //python/... @upb//python/... //python:python_version
Expand All @@ -64,6 +29,8 @@ jobs:

name: MacOS ${{ matrix.type }} ${{ matrix.version }}
runs-on: macos-12
env:
BAZEL_OSX_EXECUTE_TIMEOUT: 60
steps:
- name: Checkout pending changes
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
Expand Down Expand Up @@ -91,6 +58,7 @@ jobs:
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: python_macos/${{ matrix.type }}_${{ matrix.version }}
version: '6.1.0'
bazel: >-
test ${{ matrix.targets }} ${{ matrix.flags }}
--test_env=KOKORO_PYTHON_VERSION=${{ matrix.version }}
Expand Down
103 changes: 4 additions & 99 deletions .github/workflows/test_ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,77 +12,18 @@ permissions:
contents: read

jobs:
linux:
strategy:
fail-fast: false
matrix:
include:
- { name: Ruby 2.6, ruby: ruby-2.6.0, bazel: 5.1.1}
- { name: Ruby 2.7, ruby: ruby-2.7.0, bazel: 5.1.1}
- { name: Ruby 3.0, ruby: ruby-3.0.2, bazel: 5.1.1}
- { name: Ruby 3.1, ruby: ruby-3.1.0, bazel: 5.1.1}
- { name: Ruby 3.2, ruby: ruby-3.2.0, bazel: 5.1.1}
- { name: JRuby 9.2, ruby: jruby-9.2.20.1, bazel: 5.1.1}
- { name: JRuby 9.3, ruby: jruby-9.3.4.0, bazel: 5.1.1}
- { name: Ruby 2.6 (Bazel6), ruby: ruby-2.6.0, bazel: 6.0.0}
- { name: JRuby 9.2 (Bazel6), ruby: jruby-9.2.20.1, bazel: 6.0.0}

name: Linux ${{ matrix.name }}
runs-on: ubuntu-latest
steps:
- name: Checkout pending changes
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ inputs.safe-checkout }}
- name: Run tests
uses: protocolbuffers/protobuf-ci/bazel-docker@v1
with:
image: ${{ matrix.image || format('us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:{0}-{1}-508417e5215994ade7585d28ba3aad681a25fa5d', matrix.ruby, matrix.bazel) }}
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: ruby_linux/${{ matrix.ruby }}_${{ matrix.bazel }}
bazel: test //ruby/... //ruby/tests:ruby_version --test_env=KOKORO_RUBY_VERSION

linux-aarch64:
name: Linux aarch64
runs-on: ubuntu-latest
steps:
- name: Checkout pending changes
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ inputs.safe-checkout }}

- name: Cross compile protoc for aarch64
id: cross-compile
uses: protocolbuffers/protobuf-ci/cross-compile-protoc@v1
with:
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:5.1.1-6361b3a6e5c97e9951d03a4de28542fc45f1adab
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
architecture: linux-aarch64

- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v1
with:
image: arm64v8/ruby:2.7.3-buster
skip-staleness-check: true
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
command: >-
/bin/bash -cex '
gem install bundler;
cd /workspace/ruby;
bundle;
PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }} rake;
rake clobber_package gem;
PROTOC=/workspace/${{ steps.cross-compile.outputs.protoc }} rake test'
macos:
strategy:
fail-fast: false # Don't cancel all jobs if one fails.
matrix:
# This is the full set of versions we support on MacOS.
version: [ "2.7", "3.0", "3.1", "3.2" ]
noop: [0,1,2,3,4,5]

name: MacOS Ruby ${{ matrix.version }}
runs-on: macos-12
env:
BAZEL_OSX_EXECUTE_TIMEOUT: 60
steps:
- name: Checkout pending changes
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
Expand All @@ -101,42 +42,6 @@ jobs:
uses: protocolbuffers/protobuf-ci/bazel@v1
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
version: '6.1.0'
bazel-cache: ruby_macos/${{ matrix.version }}
bazel: test //ruby/... --test_env=KOKORO_RUBY_VERSION=${{ matrix.version }}

test_ruby_gems:
strategy:
fail-fast: false
matrix:
include:
- { name: Ruby 2.6, ruby: ruby-2.6.0, bazel: 5.1.1}
- { name: Ruby 2.7, ruby: ruby-2.7.0, bazel: 5.1.1}
- { name: Ruby 3.0, ruby: ruby-3.0.2, bazel: 5.1.1}
- { name: Ruby 3.1, ruby: ruby-3.1.0, bazel: 5.1.1}
- { name: Ruby 3.2, ruby: ruby-3.2.0, bazel: 5.1.1}
- { name: JRuby 9.2, ruby: jruby-9.2.20.1, bazel: 5.1.1}
- { name: JRuby 9.3, ruby: jruby-9.3.4.0, bazel: 5.1.1}
- { name: Ruby 2.6 (Bazel6), ruby: ruby-2.6.0, bazel: 6.0.0}
- { name: JRuby 9.2 (Bazel6), ruby: jruby-9.2.20.1, bazel: 6.0.0}
name: Install ${{ matrix.name }}
runs-on: ubuntu-latest
steps:
- name: Checkout pending changes
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
ref: ${{ inputs.safe-checkout }}
- name: Run tests
uses: protocolbuffers/protobuf-ci/bazel-docker@v1
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/ruby:${{ matrix.ruby }}-${{ matrix.bazel }}-508417e5215994ade7585d28ba3aad681a25fa5d
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: ruby_install/${{ matrix.ruby }}_${{ matrix.bazel }}
bash: >
bazel --version;
ruby --version;
bazel build //ruby:release //:protoc $BAZEL_FLAGS;
gem install bazel-bin/ruby/google-protobuf-*;
bazel-bin/protoc --proto_path=src --proto_path=ruby/tests --proto_path=ruby --ruby_out=ruby tests/test_import_proto2.proto;
bazel-bin/protoc --proto_path=src --proto_path=ruby/tests --proto_path=ruby --ruby_out=ruby tests/basic_test.proto;
ruby ruby/tests/basic.rb
Loading

0 comments on commit 46b625e

Please sign in to comment.