mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-19 15:40: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
|
@ -18,13 +18,14 @@ import (
|
|||
)
|
||||
|
||||
func TestMinioStorageIterator(t *testing.T) {
|
||||
if os.Getenv("CI") == "" {
|
||||
t.Skip("minioStorage not present outside of CI")
|
||||
endpoint := os.Getenv("TEST_MINIO_ENDPOINT")
|
||||
if endpoint == "" {
|
||||
t.Skip("TEST_MINIO_ENDPOINT not set")
|
||||
return
|
||||
}
|
||||
testStorageIterator(t, setting.MinioStorageType, &setting.Storage{
|
||||
MinioConfig: setting.MinioStorageConfig{
|
||||
Endpoint: "minio:9000",
|
||||
Endpoint: endpoint,
|
||||
AccessKeyID: "123456",
|
||||
SecretAccessKey: "12345678",
|
||||
Bucket: "gitea",
|
||||
|
@ -34,13 +35,14 @@ func TestMinioStorageIterator(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestVirtualHostMinioStorage(t *testing.T) {
|
||||
if os.Getenv("CI") == "" {
|
||||
t.Skip("minioStorage not present outside of CI")
|
||||
endpoint := os.Getenv("TEST_MINIO_ENDPOINT")
|
||||
if endpoint == "" {
|
||||
t.Skip("TEST_MINIO_ENDPOINT not set")
|
||||
return
|
||||
}
|
||||
testStorageIterator(t, setting.MinioStorageType, &setting.Storage{
|
||||
MinioConfig: setting.MinioStorageConfig{
|
||||
Endpoint: "minio:9000",
|
||||
Endpoint: endpoint,
|
||||
AccessKeyID: "123456",
|
||||
SecretAccessKey: "12345678",
|
||||
Bucket: "gitea",
|
||||
|
@ -85,13 +87,14 @@ func TestMinioStoragePath(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestS3StorageBadRequest(t *testing.T) {
|
||||
if os.Getenv("CI") == "" {
|
||||
t.Skip("S3Storage not present outside of CI")
|
||||
endpoint := os.Getenv("TEST_MINIO_ENDPOINT")
|
||||
if endpoint == "" {
|
||||
t.Skip("TEST_MINIO_ENDPOINT not set")
|
||||
return
|
||||
}
|
||||
cfg := &setting.Storage{
|
||||
MinioConfig: setting.MinioStorageConfig{
|
||||
Endpoint: "minio:9000",
|
||||
Endpoint: endpoint,
|
||||
AccessKeyID: "123456",
|
||||
SecretAccessKey: "12345678",
|
||||
Bucket: "bucket",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue