mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Embed CSV files with the test data source (#71435)
This commit is contained in:
committed by
GitHub
parent
51c94bccd7
commit
9990d5025d
@@ -59,7 +59,6 @@ var (
|
||||
Disk: &StorageLocalDiskConfig{
|
||||
Path: publicRoot,
|
||||
Roots: []string{
|
||||
"/testdata/",
|
||||
"/img/icons/",
|
||||
"/img/bg/",
|
||||
"/gazetteer/",
|
||||
@@ -75,12 +74,12 @@ func TestListFiles(t *testing.T) {
|
||||
store := newStandardStorageService(db.InitTestDB(t), roots, func(orgId int64) []storageRuntime {
|
||||
return make([]storageRuntime, 0)
|
||||
}, allowAllAuthService, cfg, nil)
|
||||
frame, err := store.List(context.Background(), dummyUser, "public/testdata")
|
||||
frame, err := store.List(context.Background(), dummyUser, "public/maps")
|
||||
require.NoError(t, err)
|
||||
|
||||
experimental.CheckGoldenJSONFrame(t, "testdata", "public_testdata.golden", frame.Frame, true)
|
||||
|
||||
file, err := store.Read(context.Background(), dummyUser, "public/testdata/js_libraries.csv")
|
||||
file, err := store.Read(context.Background(), dummyUser, "public/maps/countries.geojson")
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, file)
|
||||
|
||||
@@ -96,7 +95,7 @@ func TestListFilesWithoutPermissions(t *testing.T) {
|
||||
store := newStandardStorageService(db.InitTestDB(t), roots, func(orgId int64) []storageRuntime {
|
||||
return make([]storageRuntime, 0)
|
||||
}, denyAllAuthService, cfg, nil)
|
||||
frame, err := store.List(context.Background(), dummyUser, "public/testdata")
|
||||
frame, err := store.List(context.Background(), dummyUser, "public/maps")
|
||||
require.NoError(t, err)
|
||||
rowLen, err := frame.RowLen()
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -11,20 +11,15 @@
|
||||
// }
|
||||
// }
|
||||
// Name:
|
||||
// Dimensions: 3 Fields by 7 Rows
|
||||
// +--------------------------+-------------------------+---------------+
|
||||
// | Name: name | Name: mediaType | Name: size |
|
||||
// | Labels: | Labels: | Labels: |
|
||||
// | Type: []string | Type: []string | Type: []int64 |
|
||||
// +--------------------------+-------------------------+---------------+
|
||||
// | browser_marketshare.csv | text/csv; charset=utf-8 | 355 |
|
||||
// | flight_info_by_state.csv | text/csv; charset=utf-8 | 681 |
|
||||
// | gdp_per_capita.csv | text/csv; charset=utf-8 | 4116 |
|
||||
// | js_libraries.csv | text/csv; charset=utf-8 | 179 |
|
||||
// | ohlc_dogecoin.csv | text/csv; charset=utf-8 | 191804 |
|
||||
// | population_by_state.csv | text/csv; charset=utf-8 | 138 |
|
||||
// | weight_height.csv | text/csv; charset=utf-8 | 418121 |
|
||||
// +--------------------------+-------------------------+---------------+
|
||||
// Dimensions: 3 Fields by 2 Rows
|
||||
// +--------------------+----------------------+---------------+
|
||||
// | Name: name | Name: mediaType | Name: size |
|
||||
// | Labels: | Labels: | Labels: |
|
||||
// | Type: []string | Type: []string | Type: []int64 |
|
||||
// +--------------------+----------------------+---------------+
|
||||
// | countries.geojson | application/geo+json | 255943 |
|
||||
// | usa-states.geojson | application/geo+json | 89263 |
|
||||
// +--------------------+----------------------+---------------+
|
||||
//
|
||||
//
|
||||
// 🌟 This was machine generated. Do not edit. 🌟
|
||||
@@ -73,31 +68,16 @@
|
||||
"data": {
|
||||
"values": [
|
||||
[
|
||||
"browser_marketshare.csv",
|
||||
"flight_info_by_state.csv",
|
||||
"gdp_per_capita.csv",
|
||||
"js_libraries.csv",
|
||||
"ohlc_dogecoin.csv",
|
||||
"population_by_state.csv",
|
||||
"weight_height.csv"
|
||||
"countries.geojson",
|
||||
"usa-states.geojson"
|
||||
],
|
||||
[
|
||||
"text/csv; charset=utf-8",
|
||||
"text/csv; charset=utf-8",
|
||||
"text/csv; charset=utf-8",
|
||||
"text/csv; charset=utf-8",
|
||||
"text/csv; charset=utf-8",
|
||||
"text/csv; charset=utf-8",
|
||||
"text/csv; charset=utf-8"
|
||||
"application/geo+json",
|
||||
"application/geo+json"
|
||||
],
|
||||
[
|
||||
355,
|
||||
681,
|
||||
4116,
|
||||
179,
|
||||
191804,
|
||||
138,
|
||||
418121
|
||||
255943,
|
||||
89263
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user