this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/ci: only run e2e tests in source repo

We already had the condition that the e2e tests should only run on
protected branch for the latest-linux matrix entry, but this condition
needs to be enhanced to limit this further to the source repo and not
the trybot "shadow" repo. There are no credentials available in the
latter, so e2e tests would always fail.

Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: I5ab31580ec48c1fac4428de18cf2963913b4bbeb
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1171699
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>

+8 -5
+1 -1
.github/workflows/trybot.yml
··· 183 183 env: 184 184 GORACE: atexit_sleep_ms=10 185 185 - if: |- 186 - ((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, ' 186 + github.repository == 'cue-lang/cue' && ((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, ' 187 187 Dispatch-Trailer: {"type":"')))) && (matrix.go-version == '1.21.x' && matrix.runner == 'ubuntu-22.04') 188 188 name: End-to-end test 189 189 run: |-
+7 -4
internal/ci/github/trybot.cue
··· 118 118 _e2eTest: json.#step & { 119 119 name: "End-to-end test" 120 120 // The end-to-end tests require a github token secret and are a bit slow, 121 - // so we only run them on pushes to protected branches and on one environment. 122 - if: "\(_repo.isProtectedBranch) && \(_isLatestLinux)" 121 + // so we only run them on pushes to protected branches and on one 122 + // environment in the source repo. 123 + if: "github.repository == '\(_repo.githubRepositoryPath)' && \(_repo.isProtectedBranch) && \(_isLatestLinux)" 124 + 123 125 // The secret is the fine-grained access token "cue-lang/cue ci e2e for modules-testing" 124 126 // owned by the porcuepine bot account with read+write access to repo administration and code 125 127 // on the entire cue-labs-modules-testing org. Note that porcuepine is also an org admin, 126 128 // since otherwise the repo admin access to create and delete repos does not work. 127 129 env: GITHUB_TOKEN: "${{ secrets.E2E_GITHUB_TOKEN }}" 128 - run: """ 130 + 131 + run: """ 129 132 cd internal/e2e 130 133 go test 131 134 """ ··· 146 149 _goTestRace: json.#step & { 147 150 name: "Test with -race" 148 151 env: GORACE: "atexit_sleep_ms=10" // Otherwise every Go package being tested sleeps for 1s; see https://go.dev/issues/20364. 149 - run: "go test -race ./..." 152 + run: "go test -race ./..." 150 153 } 151 154 }