validate command
Created by: uwedeportivo
Adds a new validate
command to src-cli. This command validates a Sourcegraph instance by executing a script given as an argument. The intention is to provide a way for admins of Sourcegraph instances to verify that their new install or their upgrade went well and the instance is functioning.
The validation steps are specified in a json structure. The validation follows this outline:
- create the first admin user
- use their credentials to create an external service
- wait for repo to clone
- execute a search and check the count on the result
- delete the external service
The spec is something like this (if some of the spec structs are not declared, then the corresponding step is skipped)
{
"firstAdmin": {
"email": "[email protected]",
"username": "e2e-test-user",
"password": "123123123-e2e-test"
},
"externalService": {
"config": {
"url": "https://github.com",
"token": "{{ .github_token }}",
"orgs": [],
"repos": [
"sourcegraph-testing/zap"
]
},
"kind": "GITHUB",
"displayName": "footest",
"deleteWhenDone": true
},
"waitRepoCloned": {
"repo": "github.com/sourcegraph-testing/zap",
"maxTries": 5,
"sleepBetweenTriesSeconds": 2
},
"searchQuery": "repo:^github.com/sourcegraph-testing/zap$ SugaredLogger count:99999"
}
documentation for the command is here https://github.com/sourcegraph/sourcegraph/pull/12001