mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-20 16:10:50 +00:00
chore(ci): skip tests if TEST_{MINIO_ENDPOINT,ELASTICSEARCH_URL} is not set (#8166)
This allows the daily tests to work instead of failing because elasticsearch & minio are not present. * [Minio](https://codeberg.org/forgejo-integration/forgejo/actions/runs/10172#jobstep-5-353) * [Elasticsearch](https://codeberg.org/forgejo-integration/forgejo/actions/runs/10172#jobstep-5-272) Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8166 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
parent
4a06153709
commit
563d8f1564
3 changed files with 17 additions and 19 deletions
|
@ -16,16 +16,10 @@ import (
|
|||
)
|
||||
|
||||
func TestElasticsearchIndexer(t *testing.T) {
|
||||
// The elasticsearch instance started by testing.yml > test-unit > services > elasticsearch
|
||||
url := "http://elastic:changeme@elasticsearch:9200"
|
||||
|
||||
if os.Getenv("CI") == "" {
|
||||
// Make it possible to run tests against a local elasticsearch instance
|
||||
url = os.Getenv("TEST_ELASTICSEARCH_URL")
|
||||
if url == "" {
|
||||
t.Skip("TEST_ELASTICSEARCH_URL not set and not running in CI")
|
||||
return
|
||||
}
|
||||
url := os.Getenv("TEST_ELASTICSEARCH_URL")
|
||||
if url == "" {
|
||||
t.Skip("TEST_ELASTICSEARCH_URL not set")
|
||||
return
|
||||
}
|
||||
|
||||
require.Eventually(t, func() bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue