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

Testing isolation experiment #12068

Draft
wants to merge 79 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
f5eb2e6
change a sample for testing
davidcavazos Jul 15, 2024
ab3cf7d
change a sample for testing
davidcavazos Jul 15, 2024
50a753c
package-level testing prototype
davidcavazos Jul 17, 2024
50095bc
Merge branch 'testing-isolation' of github.com:davidcavazos/python-do…
davidcavazos Jul 17, 2024
c8dca33
functional plumbing: zip, zipWith, mapMap, groupBy
davidcavazos Jul 19, 2024
4b97738
find affected packages
davidcavazos Jul 22, 2024
0f60b21
format strategy matrix
davidcavazos Jul 22, 2024
6ee0a1d
add headers
davidcavazos Jul 22, 2024
5ae25f5
install package
davidcavazos Jul 22, 2024
5d11244
use default working directory
davidcavazos Jul 22, 2024
d9a9575
pin node version
davidcavazos Jul 22, 2024
acd60dd
run command silent
davidcavazos Jul 22, 2024
c5fc61c
pass matrix variable
davidcavazos Jul 22, 2024
9962ecc
actions matrix experiments
davidcavazos Jul 22, 2024
e1d4ba7
revert sample changes
davidcavazos Jul 22, 2024
89a0c03
consistent strategy matrix format
davidcavazos Jul 22, 2024
6732f1a
change sample file
davidcavazos Jul 22, 2024
1a397df
add debugging information
davidcavazos Jul 23, 2024
71e5e05
use pull request commit sha
davidcavazos Jul 23, 2024
87b207a
fetch origin
davidcavazos Jul 23, 2024
ae28107
fetch origin main
davidcavazos Jul 23, 2024
0b1544b
initial testing infrastructure
davidcavazos Jul 23, 2024
9508dba
change directory for test
davidcavazos Jul 23, 2024
a5c0722
avoid git fetch
davidcavazos Jul 23, 2024
48904f7
simplified code
davidcavazos Jul 23, 2024
940668b
run package tests
davidcavazos Jul 24, 2024
726f867
pass more information and copy noxfile
davidcavazos Jul 24, 2024
1946956
define cloud project
davidcavazos Jul 24, 2024
8a46ad3
configure workload identity provider
davidcavazos Jul 24, 2024
ef777fb
Merge branch 'main' of github.com:GoogleCloudPlatform/python-docs-sam…
davidcavazos Jul 24, 2024
25115d7
add norecurse directories
davidcavazos Jul 24, 2024
f715daa
use github sha
davidcavazos Jul 24, 2024
5466308
use github sha
davidcavazos Jul 24, 2024
1c411df
fix ignore paths
davidcavazos Jul 24, 2024
5a7ee11
run pytest directly
davidcavazos Jul 24, 2024
3f85f0b
use direct auth instead of service account
davidcavazos Jul 25, 2024
425b3b1
debug permissions
davidcavazos Jul 25, 2024
a01f337
re-enable tests
davidcavazos Jul 25, 2024
02b93a2
update dependencies and slight performance improvements
davidcavazos Jul 26, 2024
8eb3ed1
use nox for testing
davidcavazos Jul 26, 2024
a6d6857
simplify workflow
davidcavazos Jul 26, 2024
5c873b7
use bun instead of node
davidcavazos Jul 26, 2024
5912e78
do not use nox
davidcavazos Jul 26, 2024
bc963e6
use nox
davidcavazos Jul 26, 2024
7808de0
do not install, run directly
davidcavazos Jul 27, 2024
7e7e38a
Merge branch 'testing-isolation' of github.com:davidcavazos/python-do…
davidcavazos Jul 27, 2024
617f113
bun install, without typescript
davidcavazos Jul 27, 2024
5c2f5f6
multiple python versions
davidcavazos Jul 30, 2024
aeba0d1
fix environment variables
davidcavazos Jul 30, 2024
9d71fbc
improve ui messages
davidcavazos Jul 30, 2024
0240432
add linter
davidcavazos Jul 30, 2024
0f806cb
format code
davidcavazos Jul 30, 2024
dd748a5
change command names
davidcavazos Jul 30, 2024
c7faba0
code cleanup
davidcavazos Jul 30, 2024
23e4f88
cleanup and refactor reusable code
davidcavazos Jul 30, 2024
099ec33
fix default values for config
davidcavazos Jul 30, 2024
b8f39f6
more error handling
davidcavazos Jul 30, 2024
7272c57
initial workflow_run setup
davidcavazos Aug 15, 2024
0934aa0
rename action
davidcavazos Aug 15, 2024
776d1f3
Merge branch 'main' of github.com:GoogleCloudPlatform/python-docs-sam…
davidcavazos Aug 15, 2024
e174f5b
use go tooling
davidcavazos Sep 9, 2024
dfd6c9d
Merge branch 'main' of github.com:GoogleCloudPlatform/python-docs-sam…
davidcavazos Sep 9, 2024
4321211
revert change
davidcavazos Sep 9, 2024
f716a72
configure python lint with go tooling
davidcavazos Sep 9, 2024
d665420
fix config path
davidcavazos Sep 9, 2024
d3a4eb8
simplify workflows
davidcavazos Sep 9, 2024
71b67e0
update affected
davidcavazos Sep 9, 2024
4de7589
debug strategy matrix
davidcavazos Sep 9, 2024
f18acd0
add more debugging
davidcavazos Sep 9, 2024
e9b7f76
add more debugging
davidcavazos Sep 9, 2024
bb42901
update testing tools
davidcavazos Sep 10, 2024
3a53a68
run python lint
davidcavazos Sep 10, 2024
94c6feb
update testing tools
davidcavazos Sep 10, 2024
8f164a9
downgrade go version to use cached version
davidcavazos Sep 10, 2024
138dee3
exclude . for lint
davidcavazos Sep 10, 2024
77a02da
fix exclude
davidcavazos Sep 10, 2024
a7b2add
fix lint commands
davidcavazos Sep 10, 2024
aa44a62
use package names only
davidcavazos Sep 10, 2024
e05749f
rename jobs to packages
davidcavazos Sep 10, 2024
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
5 changes: 5 additions & 0 deletions .github/workflows/config/python.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"package": [
"noxfile_config.py"
]
}
94 changes: 94 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: PR

on:
push:
branches: main
pull_request:

env:
PROJECT: jss-22p1-test
WORKLOAD_IDENTITY_PROVIDER: projects/886556137211/locations/global/workloadIdentityPools/github-actions/providers/github-actions-python

jobs:
affected:
name: Finding affected tests
runs-on: ubuntu-latest
outputs:
python: ${{ steps.python.outputs.packages }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: ^1.22.0
- run: go install github.com/davidcavazos/testing-infra/cmd/[email protected]
- id: python
run: |
PACKAGES=$(affected .github/workflows/config/python.json)
echo "packages=$PACKAGES"
echo "packages=$PACKAGES " >> "$GITHUB_OUTPUT"

python-lint:
name: Lint Python
needs: affected
runs-on: ubuntu-latest
strategy:
matrix:
package: ${{ fromJson(needs.affected.outputs.python) }}
exclude:
- package: "."
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install nox
- run: |
cp noxfile-template.py ${{ matrix.package }}/noxfile.py
cd ${{ matrix.package }}
nox -s lint

# python-test:
# name: Test Python
# needs: affected
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
# affected: ${{fromJson(needs.affected.outputs.python)}}
# permissions: # needed for google-github-actions/auth
# id-token: write
# contents: read
# defaults:
# run:
# working-directory: .github/testing
# steps:
# - uses: actions/checkout@v4
# - uses: oven-sh/setup-bun@v2
# - uses: actions/setup-python@v5
# with:
# python-version: ${{matrix.python-version}}
# - uses: 'google-github-actions/auth@v2'
# with:
# project_id: ${{env.PROJECT}}
# workload_identity_provider: ${{env.WORKLOAD_IDENTITY_PROVIDER}}
# - run: pip install nox
# - run: bun install
# - run: bun run ci-test python${{matrix.python-version}} AFFECTED
# env:
# AFFECTED: ${{toJson(matrix.affected)}}
2 changes: 1 addition & 1 deletion language/v2/language_classify_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def sample_classify_text(

client = language_v2.LanguageServiceClient()

# Available types: PLAIN_TEXT, HTML
# Available types: PLAIN_TEXT, HTML.
document_type_in_plain_text = language_v2.Document.Type.PLAIN_TEXT

# Optional. If not specified, the language is automatically detected.
Expand Down
Loading