Behaviour test drivers
Behaviour tests isolate forge-specific code behind drivers so Gherkin scenarios stay portable.
Interfaces
| Interface | Package | Responsibility |
|---|---|---|
scm.Driver | e2e/behaviour/drivers/scm | Issues, comments, labels (via GetIssue), file commits |
ci.Driver | e2e/behaviour/drivers/ci | Workflow polling, logs, artifact download |
install.Driver | e2e/behaviour/drivers/install | Provision and tear down fullsend in the acquired pool org |
install.State | e2e/behaviour/drivers/install | Post-install config paths (script commits, workflow polling) |
v1 reference implementations:
e2e/behaviour/drivers/scm/github/e2e/behaviour/drivers/ci/githubactions/e2e/behaviour/drivers/install/perrepo_github.go(BEHAVIOUR_INSTALL_MODE=per-repo)
Runner configuration
Set when starting the suite (not in feature files):
BEHAVIOUR_SCM=github # future: gitlab, forgejo
BEHAVIOUR_CI=githubactions # future: tekton, gitlabci
BEHAVIOUR_INSTALL_MODE=per-repo # v1 default and only supported valueThe suite in e2e/behaviour/suite_test.go acquires a pool org, runs pre-install cleanup, calls install.Driver.Install, then constructs SCM and CI drivers. Unsupported BEHAVIOUR_INSTALL_MODE values fail at suite startup.
Install driver (v1 per-repo)
Uses fullsend inference provision <org>/test-repo then fullsend github setup <org>/test-repo --vendor --direct --skip-app-setup --runtime dummy with the repo-scoped WIF provider from provision (E2E_GCP_PROJECT_ID). Pool orgs must already have shared GitHub Apps, org-level mint enrollment, and per-repo mint enrollment for test-repo (one-time GCP admin step on the hosted mint project). The driver does not run fullsend admin install or fullsend mint enroll. See e2e-testing.md.
Teardown removes shim workflows, stale branches, and open fullsend PRs on test-repo via shared helpers in e2e/admin/cleanup.go.
Adding an SCM driver
- Implement
scm.Driverine2e/behaviour/drivers/scm/<vendor>/. - Register the driver in
suite_test.gowhenBEHAVIOUR_SCM=<vendor>. - Document the env var value here.
- Add
@skip:<vendor>tags on scenarios that cannot run until the driver is complete.
Use forge.Client for operations it already exposes; add REST helpers inside the driver package only when necessary (e.g. GetIssue with labels).
Adding a CI driver
- Implement
ci.Driver—WaitForWorkflow,AssertNoWorkflow,GetRunLogs,DownloadArtifacts. - Map forge
WorkflowRuntypes to portable polling logic; reuse patterns frome2e/admin/admin_test.go. - Register in suite init for the matching
BEHAVIOUR_CIvalue.
Step definitions
Steps must not import internal/forge/github directly — only drivers. This keeps scenarios vendor-agnostic.
Steps use world.Install for config repo paths (ConfigOwner, ConfigRepo, ConfigPathPrefix) instead of hardcoding the per-org .fullsend config repo.
Testing drivers
Prefer unit tests with httptest for REST helpers. Optional smoke scenarios against live backends mirror admin e2e credentials (GITHUB_TOKEN, halfsend org pool).
Future backends checklist
- [ ] GitLab SCM driver +
@skip:gitlabtag removal - [ ] Tekton or GitLab CI driver
- [ ] Per-org install driver (
BEHAVIOUR_INSTALL_MODE=per-org) - [ ] Non-GitHub install backends
