Repository navigation
Run the standard SDK tests in CI with OIDC AWS credentials - #12
Closed
tobiascadee wants to merge 1 commit into
Closed
tobiascadee wants to merge 1 commit into
tobiascadee wants to merge 1 commit into
Conversation
The Test workflow was disabled after its first run failed with NoCredentialsError: the standard singer-sdk tap tests list and read real Parquet objects from S3, and CI had no AWS credentials. The pytest job now assumes an IAM role through GitHub OIDC (configure-aws-credentials, role ARN from the AWS_ROLE_ARN repo variable), so no long-lived keys are stored in the repo. id-token: write is granted to that job only. The tap reads bucket and prefix from TAP_S3_BUCKET / TAP_S3_PREFIX (singer-sdk env config, the same names as in data-transformations), set as repo variables and pointed at the small Solvimon export so each run reads a ~3 MB file; SuiteConfig already caps the sync at 150 records. tox strips the environment, so AWS_* joins pass_env to forward the temporary credentials and region to pytest. The matrix version is passed through env instead of being templated into run:, which drops the zizmor ignore comment; the template's TODO header goes too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tobiascadee
force-pushed
the
tobias/add-standard-tests-workflow
branch
from
October 23, 2026 09:39
2622537 to
106219d
Compare
Collaborator
Author
|
Not adding the test workflow for now; only the dependency update (#11) goes in. |
tobiascadee
added a commit
that referenced
this pull request
Oct 27, 2026
The standard SDK tests listed and read real Parquet objects from S3, so they only passed with an authenticated AWS session. CI had none, which is why the Test workflow was disabled and #12 (OIDC role) was dropped. The shared ruleset needs `test` to report and pass on every PR. tests/conftest.py starts moto's S3 mock in pytest_configure, before collection, since the SDK discovers the stream schema while collecting. It uploads one generated Parquet file under the SAMPLE_CONFIG bucket/prefix, covering every type branch of the Arrow-to-JSON-schema mapping (int, float, bool, string, timestamp, list, struct, a NULL), plus a `_SUCCESS` marker that the `.parquet` filter must skip. Fake credentials replace any local AWS_PROFILE, so the tests never reach real AWS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tobiascadee
added a commit
that referenced
this pull request
Oct 27, 2026
The standard SDK tests listed and read real Parquet objects from S3, so they only passed with an authenticated AWS session. CI had none, which is why the Test workflow was disabled and #12 (OIDC role) was dropped. The shared ruleset needs `test` to report and pass on every PR. tests/conftest.py starts moto's S3 mock in pytest_configure, before collection, since the SDK discovers the stream schema while collecting. It uploads one generated Parquet file under the SAMPLE_CONFIG bucket/prefix with int, float, bool, string, timestamp, list and struct columns and a NULL, plus a `_SUCCESS` marker that the `.parquet` filter must skip. Fake credentials replace any local AWS_PROFILE, so the tests never reach real AWS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tobiascadee
added a commit
that referenced
this pull request
Oct 27, 2026
# What Report stable `lint` and `test` checks on every pull request, and make the code pass `lint`. # Why The shared `main` ruleset (applied 2026-10-27) can't require status checks yet. Most test workflows filter `pull_request` by `paths:`, so a required check never reports on a PR that touches no code (TicketSwap/tap-exact#307 could only merge through the bypass). Job names also differ per repo and include the Python version (`Test (3.12)`, `Integration Tests (3.10)`). Most repos had no lint job at all. Once this lands in all 14 tap/target repos, the ruleset requires `lint` and `test`. ## Changes - remove the `paths:` filter from the `pull_request` trigger (the `push` filter stays) - `lint` job: `uvx ruff@0.17.3 check` and `uvx ruff@0.17.3 format --check` over the whole repo with the repo's own ruff config. Ruff is pinned so a new release can't turn the required check red on its own; bumping it is a one-line change in each repo - `test` job (`needs: [pytest]`, `if: always()`) fails unless every matrix leg passed, so the check name doesn't depend on the Python versions; the legs run as `pytest (3.x)` The second commit makes the code pass: ruff autofixes and `ruff format`, plus a handful of hand fixes. Its message lists each one. `noqa` is used only where the real fix would mean a refactor or changing a signature the SDK defines. The third commit makes the tests run offline. The Test workflow was disabled because the SDK tests read real Parquet files from S3 and CI has no AWS access (see #12). `tests/conftest.py` now starts a moto S3 mock before collection and uploads a generated Parquet file under the `SAMPLE_CONFIG` bucket and prefix, so all 15 SDK tests pass without AWS. `moto[s3]` is added to the `test` dependency group. The Test workflow is re-enabled. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Make the
Test tap-s3workflow run the standard singer-sdk tap tests on every PR, with AWS access through GitHub OIDC.Stacked on #11 (
tobias/update-dependencies); retarget tomainonce #11 merges.Why
The workflow is
disabled_manually: its only run failed withNoCredentialsErrorbecause the SDK tests read real Parquet files from S3 and CI had no AWS credentials. Running them on PRs catches singer-sdk/pyarrow regressions before a tag is pinned in data-transformations'meltano.yml.Changes
pytestjob assumes an IAM role viaaws-actions/configure-aws-credentialsv6.3.0 (SHA-pinned),role-to-assume: ${{ vars.AWS_ROLE_ARN }}, regioneu-west-1;id-token: writeon that job onlyTAP_S3_BUCKET/TAP_S3_PREFIXfrom repo variables on the tox step (singer-sdk env config overrides the placeholderSAMPLE_CONFIG)pass_envaddsAWS_*so the temporary credentials and region reach pytestrun:(drops thezizmor: ignorecomment); removed the template TODO headerLocal check:
uvx --with=tox-uv tox -e 3.11with env-var credentials (as OIDC provides them) and the Solvimon prefix: 18 passed. zizmor 1.31.1: no findings.Needed before the tests can pass
AWS_ROLE_ARN: IAM role trustingtoken.actions.githubusercontent.com(audsts.amazonaws.com, subrepo:TicketSwap/tap-s3:*), withs3:ListBucketonticketswap-clickhouse(prefixreverse-etl/retl_solvimon_ticket_events/) ands3:GetObjectonticketswap-clickhouse/reverse-etl/retl_solvimon_ticket_events/*TAP_S3_BUCKET=ticketswap-clickhouseTAP_S3_PREFIX=reverse-etl/retl_solvimon_ticket_events/gh workflow enable test.yml -R TicketSwap/tap-s3LLM Transparency
Note
LLM usage: 100 %
To be notified
Links
🤖 Generated with Claude Code