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

x/vuln/internal/worker: TestTemplates consistently failing on Android builders #50013

Closed
bcmills opened this issue Dec 7, 2021 · 4 comments
Closed
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile NeedsFix The path to resolution is known, but the work has not been done. okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1 release-blocker Soon This needs action soon. (recent regressions, service outages, unusual time-sensitive situations) Testing An issue that has been verified to require only test changes, not just a test failure. vulncheck or vulndb Issues for the x/vuln or x/vulndb repo
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Dec 7, 2021

--- FAIL: TestTemplates (0.00s)
    server_test.go:19: open static/index.tmpl: no such file or directory
2021/12/07 02:00:22 INFO HEAD http://127.0.0.1:39427/mod/golang.org/x/mod latency=4.47193ms status="200 OK" error=<nil>
2021/12/07 02:00:22 INFO HEAD http://127.0.0.1:39427/mod/github.com/something/something latency=1.84903ms status="404 Not Found" error=<nil>
2021/12/07 02:00:22 INFO update starting commit=7b52590f27fffbff0304986d9a80e7974dfbaf67
2021/12/07 02:00:22 INFO update transaction startID=CVE-2020-9283 endID=CVE-2020-9283 adds=1 mods=0
2021/12/07 02:00:22 INFO update transaction startID=CVE-2021-0001 endID=CVE-2021-0010 adds=2 mods=0
2021/12/07 02:00:22 INFO update transaction startID=CVE-2021-1384 endID=CVE-2021-1384 adds=1 mods=0
2021/12/07 02:00:22 INFO update succeeded numProcessed=4
2021/12/07 02:00:22 INFO update starting commit=7b52590f27fffbff0304986d9a80e7974dfbaf67
2021/12/07 02:00:22 INFO update transaction startID=CVE-2020-9283 endID=CVE-2020-9283 adds=0 mods=0
2021/12/07 02:00:22 INFO update transaction startID=CVE-2021-0001 endID=CVE-2021-0010 adds=0 mods=0
2021/12/07 02:00:22 INFO update transaction startID=CVE-2021-1384 endID=CVE-2021-1384 adds=0 mods=0
2021/12/07 02:00:22 INFO update succeeded numProcessed=4
2021/12/07 02:00:22 INFO update starting commit=7b52590f27fffbff0304986d9a80e7974dfbaf67
2021/12/07 02:00:22 INFO update transaction startID=CVE-2020-9283 endID=CVE-2020-9283 adds=1 mods=0
2021/12/07 02:00:22 INFO update transaction startID=CVE-2021-0001 endID=CVE-2021-0010 adds=0 mods=2
2021/12/07 02:00:22 INFO update transaction startID=CVE-2021-1384 endID=CVE-2021-1384 adds=0 mods=1
2021/12/07 02:00:22 INFO update succeeded numProcessed=4
2021/12/07 02:00:22 INFO update starting commit=7b52590f27fffbff0304986d9a80e7974dfbaf67
2021/12/07 02:00:22 INFO update transaction startID=CVE-2020-9283 endID=CVE-2020-9283 adds=1 mods=0
2021/12/07 02:00:22 INFO update transaction startID=CVE-2021-0001 endID=CVE-2021-0010 adds=0 mods=2
2021/12/07 02:00:22 INFO update transaction startID=CVE-2021-1384 endID=CVE-2021-1384 adds=1 mods=0
2021/12/07 02:00:22 INFO update succeeded numProcessed=4
2021/12/07 02:00:22 INFO CreateIssues starting destination=in memory
2021/12/07 02:00:22 INFO created issue CVE=ID1 reference=inMemory#1
2021/12/07 02:00:22 INFO CreateIssues done limit=0 numCreated=1
FAIL
exitcode=1FAIL	golang.org/x/vuln/internal/worker	37.170s

The problem here is that the Android test-runner script only copies in the testdata directories and subtree from the package under test to the root of the repo, whereas this test is loading data from its own static subdirectory.

Some viable options to fix the test include:

  1. Switch the package to use go:embed for static assets, so that neither the worker package nor its test binary needs to load the static assets dynamically at all.
  2. Explicitly skip this test on mobile builders.
  3. Stop testing the x/vuln repo on mobile builders entirely.
  4. Move the static assets up to the internal/worker directory.
@gopherbot gopherbot added this to the Unreleased milestone Dec 7, 2021
@bcmills bcmills added mobile Android, iOS, and x/mobile NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure. okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1 release-blocker Soon This needs action soon. (recent regressions, service outages, unusual time-sensitive situations) labels Dec 7, 2021
@bcmills bcmills modified the milestones: Unreleased, Go1.18 Dec 7, 2021
@bcmills
Copy link
Contributor Author

bcmills commented Dec 7, 2021

This is a release-blocker for Go 1.18 via #11811. This test was added in CL 368855.

@jba
Copy link
Contributor

jba commented Dec 7, 2021

Trybots will soon be removed from this repo (https://golang.org/cl/369837).

@findleyr
Copy link
Member

findleyr commented Dec 7, 2021

I don't know how critical Android builders are for these test -- perhaps for html rendering not very critical.

In x/tools we have many tests that need the repo contents, e.g. for testing documentation. For those we simply skip the mobile builders.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/370094 mentions this issue: internal/worker: run tests only on go 1.17 or higher

@julieqiu julieqiu added the vulncheck or vulndb Issues for the x/vuln or x/vulndb repo label Sep 8, 2022
softdev050 added a commit to softdev050/Golangvuln that referenced this issue Apr 5, 2023

Verified

This commit was signed with the committer’s verified signature.
myitcv Paul Jolly
The trybots will run all tests on both 1.17 and 1.16. We don't
care about being 1.16-compatible, so don't run our tests on it.

Also, the android builder doesn't copy the full repo, which
breaks our test of HTML templates. So disable android for
that file.

Fixes golang/go#50013

Change-Id: I7379eff1226b50667da156e1b93c2759d618547d
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/370094
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
sayjun0505 added a commit to sayjun0505/Golangvuln that referenced this issue Apr 8, 2023

Verified

This commit was signed with the committer’s verified signature.
myitcv Paul Jolly
The trybots will run all tests on both 1.17 and 1.16. We don't
care about being 1.16-compatible, so don't run our tests on it.

Also, the android builder doesn't copy the full repo, which
breaks our test of HTML templates. So disable android for
that file.

Fixes golang/go#50013

Change-Id: I7379eff1226b50667da156e1b93c2759d618547d
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/370094
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
stanislavkononiuk added a commit to stanislavkononiuk/Golangvuln that referenced this issue Jun 26, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
The trybots will run all tests on both 1.17 and 1.16. We don't
care about being 1.16-compatible, so don't run our tests on it.

Also, the android builder doesn't copy the full repo, which
breaks our test of HTML templates. So disable android for
that file.

Fixes golang/go#50013

Change-Id: I7379eff1226b50667da156e1b93c2759d618547d
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/370094
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
@golang golang locked and limited conversation to collaborators Sep 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge mobile Android, iOS, and x/mobile NeedsFix The path to resolution is known, but the work has not been done. okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1 release-blocker Soon This needs action soon. (recent regressions, service outages, unusual time-sensitive situations) Testing An issue that has been verified to require only test changes, not just a test failure. vulncheck or vulndb Issues for the x/vuln or x/vulndb repo
Projects
Status: No status
Development

No branches or pull requests

5 participants