]> source.dussan.org Git - gitea.git/commitdiff
Update heatmap fixtures to restore tests (#8615) (#8617)
authorzeripath <art27@cantab.net>
Mon, 21 Oct 2019 21:19:27 +0000 (22:19 +0100)
committerGitHub <noreply@github.com>
Mon, 21 Oct 2019 21:19:27 +0000 (22:19 +0100)
* Update heatmap fixtures to restore tests
* Add hint to check the fixture age on fail

integrations/api_user_heatmap_test.go
models/fixtures/action.yml
models/user_heatmap_test.go

index 5c65dc1bcaad19615e5821b7680270e1aadc6ed6..fd98a17ef479cea44e99f9f72c1c6d3d033227bb 100644 (file)
@@ -24,7 +24,7 @@ func TestUserHeatmap(t *testing.T) {
        var heatmap []*models.UserHeatmapData
        DecodeJSON(t, resp, &heatmap)
        var dummyheatmap []*models.UserHeatmapData
-       dummyheatmap = append(dummyheatmap, &models.UserHeatmapData{Timestamp: 1540080000, Contributions: 1})
+       dummyheatmap = append(dummyheatmap, &models.UserHeatmapData{Timestamp: 1571616000, Contributions: 1})
 
        assert.Equal(t, dummyheatmap, heatmap)
 }
index 34a1a8b2be0276cc933d27c1b8b7cf83cb2f98d3..e8a6d531f2b33825d7db2297350a1d3bc64b1ad4 100644 (file)
@@ -5,7 +5,7 @@
   act_user_id: 2
   repo_id: 2
   is_private: true
-  created_unix: 1540139562
+  created_unix: 1571686356
 
 -
   id: 2
index a71202d85716ea821b489f15e55098e1b8a2ef6a..f882b3524733d43833c97f5d567f1f3fed173401 100644 (file)
@@ -17,7 +17,7 @@ func TestGetUserHeatmapDataByUser(t *testing.T) {
                CountResult int
                JSONResult  string
        }{
-               {2, 1, `[{"timestamp":1540080000,"contributions":1}]`},
+               {2, 1, `[{"timestamp":1571616000,"contributions":1}]`},
                {3, 0, `[]`},
        }
        // Prepare
@@ -41,7 +41,7 @@ func TestGetUserHeatmapDataByUser(t *testing.T) {
                // Get the heatmap and compare
                heatmap, err := GetUserHeatmapDataByUser(user)
                assert.NoError(t, err)
-               assert.Equal(t, len(actions), len(heatmap))
+               assert.Equal(t, len(actions), len(heatmap), "invalid action count: did the test data became too old?")
                assert.Equal(t, tc.CountResult, len(heatmap))
 
                //Test JSON rendering