(t *testing.T)
| 772 | } |
| 773 | |
| 774 | func TestPollComparePreviousResults(t *testing.T) { |
| 775 | zero := backend.MustParse("00000000-0000-0000-0000-000000000000") |
| 776 | aaa := backend.MustParse("00000000-0000-0000-0000-00000000000A") |
| 777 | eff := backend.MustParse("00000000-0000-0000-0000-00000000000F") |
| 778 | |
| 779 | testCases := []struct { |
| 780 | name string |
| 781 | |
| 782 | previousPerTenant PerTenant |
| 783 | previousCompactedPerTenant PerTenantCompacted |
| 784 | |
| 785 | currentPerTenant PerTenant |
| 786 | currentCompactedPerTenant PerTenantCompacted |
| 787 | |
| 788 | expectedPerTenant PerTenant |
| 789 | expectedCompactedPerTenant PerTenantCompacted |
| 790 | |
| 791 | expectedBlockMetaCalls map[string]map[uuid.UUID]int |
| 792 | expectedCompactedBlockMetaCalls map[string]map[uuid.UUID]int |
| 793 | |
| 794 | tollerateErrors int |
| 795 | tollerateTenantFailures int |
| 796 | |
| 797 | readerErr bool |
| 798 | err error |
| 799 | }{ |
| 800 | { |
| 801 | name: "with no previous results, the blocklist is polled", |
| 802 | previousPerTenant: PerTenant{}, |
| 803 | previousCompactedPerTenant: PerTenantCompacted{}, |
| 804 | currentPerTenant: PerTenant{ |
| 805 | "test": []*backend.BlockMeta{ |
| 806 | {BlockID: zero}, |
| 807 | }, |
| 808 | }, |
| 809 | currentCompactedPerTenant: PerTenantCompacted{ |
| 810 | "test": []*backend.CompactedBlockMeta{ |
| 811 | {BlockMeta: backend.BlockMeta{BlockID: eff}}, |
| 812 | }, |
| 813 | }, |
| 814 | expectedPerTenant: PerTenant{ |
| 815 | "test": []*backend.BlockMeta{ |
| 816 | {BlockID: zero}, |
| 817 | }, |
| 818 | }, |
| 819 | expectedCompactedPerTenant: PerTenantCompacted{ |
| 820 | "test": []*backend.CompactedBlockMeta{ |
| 821 | {BlockMeta: backend.BlockMeta{BlockID: eff}}, |
| 822 | }, |
| 823 | }, |
| 824 | expectedBlockMetaCalls: map[string]map[uuid.UUID]int{ |
| 825 | "test": { |
| 826 | (uuid.UUID)(zero): 1, |
| 827 | }, |
| 828 | }, |
| 829 | expectedCompactedBlockMetaCalls: map[string]map[uuid.UUID]int{ |
| 830 | "test": { |
| 831 | (uuid.UUID)(eff): 1, |
nothing calls this directly
no test coverage detected