aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/app/util_test.go
Commit message (Collapse)AuthorAgeFilesLines
* dashboard/app: add spanner Jobs.Correct fieldDmitry Vyukov2026-01-131-6/+31
| | | | | | Lay down foundation for spanner DB migrations by adding Jobs.Correct field. This will allow us to test deployment of such changes. The field will be used to record results of manual assessment of AI job results.
* dashboard/app: add support for AI workflowsDmitry Vyukov2026-01-051-0/+15
| | | | | | | | Support for: - polling for AI jobs - handling completion of AI jobs - submitting job trajectory logs - basic visualization for AI jobs
* dashboard/app: make it possible to test code that uses spannerDmitry Vyukov2025-12-311-0/+57
| | | | | | Start spanner emulator for tests. Create isolated per-test instance+database. Test that DDL migration scripts are work.
* all: use any instead of interface{}Dmitry Vyukov2025-12-221-5/+5
| | | | Any is the preferred over interface{} now in Go.
* dashboard/app: set aetest startup timeoutPimyn Girgis2025-11-031-0/+1
| | | | | Set aetest startup timeout to 120 seconds to prevent flaky tests from failing due to timeouts. This is especially helpful on slower machines or when the system is under heavy load.
* all: simplify subsystem revision updatesAleksandr Nogikh2025-07-231-6/+1
| | | | | | Don't specify the subsystem revision in the dashboard config and instead let it be nested in the registered subsystems. This reduces the amount of the manual work needed to switch syzbot to a newer subsystem list.
* all: apply linter auto fixesTaras Madan2025-07-171-2/+3
| | | | ./tools/syz-env bin/golangci-lint run ./... --fix
* dashboard: forward emails from designated inboxesAleksandr Nogikh2025-07-031-1/+1
| | | | | | For some specified inboxes, forward the emails that contain syz commands. Add tests to verify the behavior.
* dashboard/app: allow to set spanner context only from testsTaras Madan2025-05-051-1/+1
| | | | getSpannerClient returns prod client as a default.
* dashboard/app: test coverage /file linkTaras Madan2025-01-271-0/+16
| | | | | | | | 1. Init coveragedb client once and propagate it through context to enable mocking. 2. Always init coverage handlers. It simplifies testing. 3. Read webGit and coveragedb client from ctx to make it mockable. 4. Use int for file line number and int64 for merged coverage. 5. Add tests.
* dashboard/app: use makeUser insteadTaras Madan2024-10-211-10/+4
|
* dashboard/api: add Client typeDmitry Vyukov2024-10-151-13/+21
|
* dashboard: fix TestAccessAleksandr Nogikh2024-07-111-9/+5
| | | | | | | | | | | The test has recently become broken, but we didn't notice it in our presubmit testing. Fix the problem (ReproLog being set to 0). Run TestAccess also in -short mode, but limit it to ensuring that non-public URLs are not accessible publicly. The short test now takes 60 seconds compared to 104 seconds without -short.
* dashboard: support manual reproduction requestsAleksandr Nogikh2024-06-251-4/+19
| | | | | | | As it is problematic to set up automatic bidirectional sharing of reproducer files between namespaces, let's support the ability to manually request a reproduction attempt on a specific syz-manager instance. That should help in the time being.
* dashboard/app: fix bad use of context valuesDmitry Vyukov2024-04-261-3/+3
| | | | | | | | | Linter warns: dashboard/app/util_test.go:680:47: SA1029: should not use built-in type string as key for value; define your own type to avoid collisions newContext := context.WithValue(r.Context(), requestIDKey, requestNum) ^
* all: fix up context import after go fixDmitry Vyukov2024-04-261-1/+1
|
* all: go fix everythingDmitry Vyukov2024-04-261-1/+1
|
* makefile, dashboard/app/util_test.go: test split by dev_appserver.pyTaras Madan2024-02-281-1/+1
|
* dashboard: wait for repro only when it makes senseAleksandr Nogikh2024-01-181-0/+11
| | | | | In case or build/boot/test errors there will never be a reproducer. It's better to report them right away, without waiting.
* dashboard: throttle incoming requestsAleksandr Nogikh2023-11-031-0/+1
| | | | | To ensure service stability, let's rate limit incoming requests to our web endpoints.
* dashboard: forward incoming commands emailsAleksandr Nogikh2023-11-021-0/+21
| | | | | | | Instead of reminding users to mention our mailing lists, forward their emails there automatically. Closes #4260.
* dashboard: check config's integrity during testsAleksandr Nogikh2023-10-121-1/+1
| | | | | Marshal the config at the installing and during getConfig() to ensure that it's not accidentally changed during code execution.
* dashboard: access config through contextAleksandr Nogikh2023-10-121-7/+67
| | | | | | | | | | | | | | | | | | | | | We used to have a single global `config` variable and access it throughout the whole dashboard application. However, this approach has been more and more complicated test writing -- sometimes we want the config to be only slightly different, so that it's not worth it adding new namespaces, sometimes we have to test how dashboard handles config changes over time. This has already led to a number of hacky contextWithXXX methods that mocked various parts of the global variable. The rest of the code had to sometimes still use `config` directly and sometimes invoke getXXX(c) methods. This is very inconsistent and prone to errors. With more and more situations where we need to patch the config appearing (see #4118), let's refactor the application to always access config via the getConfig(c) method. This allows us to uniformly patch the config and be sure that the non-patched copy is not accessible from anywhere else.
* all: use errors.As instead of .(type)Taras Madan2023-07-241-2/+3
|
* dashboard/app/util_test.go: *HTTPError not HTTPErrorTaras Madan2023-07-201-3/+3
|
* dashboard: fix the Config.Decommissioned raceAleksandr Nogikh2023-07-181-0/+6
| | | | | | | | | | Race detector reports a race between dashboard/app/reporting_test.go:1102 and dashboard/app/handler.go:183 Fix this by storing decommission updates in the context rather than by directly modifying the global config variable.
* all: restructure testsAleksandr Nogikh2023-07-121-1/+2
| | | | | Let presubmit_dashboard run dashboard tests and presubmit_build run all others.
* all: remove mentions of big-envAleksandr Nogikh2023-07-121-1/+1
| | | | Use just env instead of that.
* dashboard: order bugs in a report by their priorityAleksandr Nogikh2023-07-061-1/+7
| | | | | Display high prio bugs on top of the list and low prio bugs at the bottom.
* dashboard: allow admins to retry individual bisectionsSpace Meyer2023-06-121-0/+18
| | | | | | | | | | Changes to our rootfs, compilers or bisection logic regularly cause regressions in our bisection accuracy. Retrying them currently entails fiddling with the GCP datastore directly or mass deleting all failed bisections. This change will allow us to retry specific bisections with a single click.
* dashboard: optionally disable bug obsoletionAleksandr Nogikh2023-05-191-0/+6
| | | | This allows us to write cleaner tests.
* dashboard: determine bug origin trees and missing backportsAleksandr Nogikh2023-04-281-0/+6
| | | | | | | | | | | | | | | Run reproducers on other trees in order to determine 1) Trees where a bug originates (i.e. the reproducer can trigger a bug in none of the further trees, from which commits flow). 2) Trees, to which the bug has already spread (i.e. the reproducer works on none of the trees that receive commits from the current one). 3) The abscence of a backport (= the reproducer used to work on some upstream tree and then stopped). For (1) the bot assigns the LabelIntroduced from KernelRepo. For (2) -- the value of LabelReached. For better understanding see sample configs in tree_test.go.
* dashboard: lazily generate repro retesting jobsAleksandr Nogikh2023-04-191-5/+0
| | | | | | | | | | | | | Refactor patch testing functionality. Instead of creating patch testing jobs per cron, create them on demand during pollJob(). This allows to only create jobs for managers that do support jobs and also simplifies further changes that are related to patch testing. As there are too many bugs and poll period is quite small, don't query all the database each time. Consider a random subset of bugs each time, this should be enough given high poll rate.
* dashboard: collect and display bug-related discussionsAleksandr Nogikh2023-04-061-1/+1
| | | | | | | | | Collect the information about the discussions under bug reports and patches that target the reported bugs. For now only Lore discussions are supported. Display the discussion list on the bug info page.
* dashboard: introduce per-subsystem reminders about open bugsAleksandr Nogikh2023-03-241-0/+11
| | | | | | | | | Once in a month, collect for each subsystem the list of bugs that are still open on the syzbot dashboard and send an email to the corresponding mailing list. Support manual moderation of such reminders, we'll need that at least for the time being.
* all: ioutil is deprecated in go1.19 (#3718)Taras Madan2023-02-231-2/+2
|
* dashboard: periodically refresh bug subsystemsAleksandr Nogikh2023-02-161-0/+11
| | | | | | | | | This will both help set subsystems for bugs that existed before these changes and keep subsystems up to date with changes to the subsystem list. Do the update once a month for open bugs and also update all open and fixed bugs every time a revision changes.
* dashboard: directly transform request contextAleksandr Nogikh2023-02-161-19/+16
| | | | | Instead of exposing a map with the list of variables to set, let users specify a callback to transform context.Context before making a request.
* dashboard: move /email_poll to /cron/email_pollAleksandr Nogikh2023-02-141-3/+3
| | | | | Currently it's the only cron job that is still occupying a top level URL.
* dashboard: move all cron endpoints to cron/Aleksandr Nogikh2023-02-131-1/+1
| | | | | | This lets us keep only one access rule and reliefs from the need to keep handlers and app.yaml in sync for cron jobs that'll be added in the future.
* dashboard: make expectOK more elaborateAleksandr Nogikh2023-01-301-1/+1
| | | | | Now it's quite difficult to recognize it in the dashboard testing logs, especially when the error message itself is not very clear.
* dashboard: test subsystem filteringAleksandr Nogikh2023-01-271-4/+11
| | | | | In order to do that, we need to tweak the subsystem extraction code. Use context values, as this should simplify the flow.
* dashboard: use context variables for mockingAleksandr Nogikh2023-01-271-9/+25
| | | | | | | Currently we use context.Context values themselves, but that limits the ability to derive contexts during the request processing. Also, the race detector is reporting a data race during the `reflect.DeepEqual` comparison.
* dashboard: make Ctx.ContentType more robustAleksandr Nogikh2023-01-261-1/+8
| | | | | | | If the underlying request fails, we get the `panic: runtime error: invalid memory address or nil pointer dereference` error. Gracefully handle the possible edge cases.
* dashboard: always close a dev_appserver instanceAleksandr Nogikh2023-01-171-1/+1
| | | | | | | | | | | Currently, if one of the ctx.Close asserts fails, we never close the connection to the dev_appserver instance we use. As a result, the application created by `go test` is left with lots of orphaned dev_appserver children and `go test` endlessly waits for them to stop. Defer the aetest.Instance.Close() call to prevent this from happening.
* dashboard/app/graphs.go: 4xx on bad metric value, not panic (#3602)Taras Madan2022-12-301-4/+12
| | | * dashboard/app/graphs.go: return 400 if bad input
* dashboard: speed up the TestPurgeOldCrashes test()`Aleksandr Nogikh2022-12-091-0/+5
| | | | | | | | | | | This test is skipped during short testing, but during the full testing it takes most of the time. At the same time, for testing purposes it's actually irrelevant whether we keep 40 or 20 crashes, so we're just wasting time. Make maxCrashes() mockable and set it to 20 during testing. This makes full testing 1.5x faster and also gives a small speed improvement for -short testing.
* dashboard: adjust job tests to public namespacesAleksandr Nogikh2022-12-051-7/+9
| | | | | After the previous commit, our existing patch testing jobs began to fail. Fix this by switching them to another test namespace.
* dashboard: send user-friendly bug from title matching errorsAleksandr Nogikh2022-11-251-9/+7
| | | | | | | Explicitly tell users about the situations when the incoming request could be related to several different syzbot bugs. Test this behavior.
* dashboard: fix the broken AccessTestAleksandr Nogikh2022-11-221-9/+9
| | | | | | | | The test config changes needed for the recent changes in incoming email handling testing accidentally broke the AccessTest. Fix this by introducing a separate test namespace for public email testing.