summaryrefslogtreecommitdiffstats
path: root/modules/indexer
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2020-05-30 10:46:15 +0300
committerGitHub <noreply@github.com>2020-05-30 10:46:15 +0300
commitea4c139cd2f7e5174627a40aa8a9973fabf508ff (patch)
treebcdcfc9cb15c56799af03bacbae3d25790539a02 /modules/indexer
parent4395c607ed79985602a99dda251f090fbd2f5cf9 (diff)
downloadgitea-ea4c139cd2f7e5174627a40aa8a9973fabf508ff.tar.gz
gitea-ea4c139cd2f7e5174627a40aa8a9973fabf508ff.zip
Change language statistics to save size instead of percentage (#11681)
* Change language statistics to save size instead of percentage in database Co-Authored-By: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> * Do not exclude if only language * Fix edge cases with special langauges Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
Diffstat (limited to 'modules/indexer')
-rw-r--r--modules/indexer/stats/indexer_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/indexer/stats/indexer_test.go b/modules/indexer/stats/indexer_test.go
index 29d0f6dbe4..b60c6d9bb4 100644
--- a/modules/indexer/stats/indexer_test.go
+++ b/modules/indexer/stats/indexer_test.go
@@ -34,6 +34,9 @@ func TestRepoStatsIndex(t *testing.T) {
repo, err := models.GetRepositoryByID(1)
assert.NoError(t, err)
+ status, err := repo.GetIndexerStatus(models.RepoIndexerTypeStats)
+ assert.NoError(t, err)
+ assert.Equal(t, "65f1bf27bc3bf70f64657658635e66094edbcb4d", status.CommitSha)
langs, err := repo.GetTopLanguageStats(5)
assert.NoError(t, err)
assert.Len(t, langs, 1)