Revert "Say that a deploy keeps only an app's volumes when the app has none"
Check / check (pull_request) Skipped
Check / check (pull_request) Skipped
This reverts commit cc786a1e84, at the
owner's request. It removes the app page sentence for an app with no
volume mounts, the matching deploy log line and its constant, their
tests, the README sentence and the TODO.md entry. The environment
variable hint keeps its alert-warning class, which is in the committed
stylesheet.
Model: opus-5-5
This commit is contained in:
@@ -21,7 +21,6 @@ import (
|
||||
"sneak.berlin/go/upaas/internal/database"
|
||||
"sneak.berlin/go/upaas/internal/models"
|
||||
"sneak.berlin/go/upaas/internal/service/app"
|
||||
"sneak.berlin/go/upaas/internal/service/deploy"
|
||||
"sneak.berlin/go/upaas/templates"
|
||||
)
|
||||
|
||||
@@ -195,7 +194,6 @@ func (h *Handlers) HandleAppDetail() http.HandlerFunc {
|
||||
"EnvVars": envVars,
|
||||
"Labels": labels,
|
||||
"Volumes": volumes,
|
||||
"NoVolumesWarning": deploy.NoVolumesWarning,
|
||||
"Ports": ports,
|
||||
"Deployments": deployments,
|
||||
"LatestDeployment": latestDeployment,
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
package handlers_test
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"sneak.berlin/go/upaas/internal/models"
|
||||
"sneak.berlin/go/upaas/internal/service/deploy"
|
||||
)
|
||||
|
||||
// TestAppPageSaysFilesAreLostOnlyWhenAppHasNoVolumes checks that the app page
|
||||
// shows deploy.NoVolumesWarning until the app gets a volume mount.
|
||||
func TestAppPageSaysFilesAreLostOnlyWhenAppHasNoVolumes(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
testCtx := setupTestHandlers(t)
|
||||
createdApp := createTestApp(t, testCtx, "no-volumes-app")
|
||||
|
||||
renderAppPage := func() string {
|
||||
request := httptest.NewRequestWithContext(
|
||||
t.Context(), http.MethodGet, "/apps/"+createdApp.ID, nil,
|
||||
)
|
||||
request = addChiURLParams(request, map[string]string{"id": createdApp.ID})
|
||||
recorder := httptest.NewRecorder()
|
||||
|
||||
testCtx.handlers.HandleAppDetail().ServeHTTP(recorder, request)
|
||||
require.Equal(t, http.StatusOK, recorder.Code)
|
||||
|
||||
return recorder.Body.String()
|
||||
}
|
||||
|
||||
assert.Contains(t, renderAppPage(), deploy.NoVolumesWarning)
|
||||
|
||||
volume := models.NewVolume(testCtx.database)
|
||||
volume.AppID = createdApp.ID
|
||||
volume.HostPath = "/srv/no-volumes-app"
|
||||
volume.ContainerPath = "/data"
|
||||
require.NoError(t, volume.Save(t.Context()))
|
||||
|
||||
assert.NotContains(t, renderAppPage(), deploy.NoVolumesWarning)
|
||||
}
|
||||
Reference in New Issue
Block a user