Skip to content

feat: blacklist -> ignorelist and platform fixes#57

Closed
vladimirvolek wants to merge 6 commits intomainfrom
ignorelist-as-param
Closed

feat: blacklist -> ignorelist and platform fixes#57
vladimirvolek wants to merge 6 commits intomainfrom
ignorelist-as-param

Conversation

@vladimirvolek
Copy link
Copy Markdown
Member

No description provided.

@vladimirvolek vladimirvolek changed the title feat: blacklist -> ignorelist and configurable feat: blacklist -> ignorelist and platform fixes Mar 16, 2026
@vladimirvolek vladimirvolek marked this pull request as ready for review March 16, 2026 14:43
@vladimirvolek vladimirvolek requested a review from Copilot March 16, 2026 14:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the test-generation/fixture system to replace “blacklist” terminology with “ignorelist”, adds an IGNORELIST_ONLY mode for CI workflows, and updates address transaction fixtures to better separate paginated vs from/to query behaviors.

Changes:

  • Rename blacklist rules/utilities to ignorelist equivalents and load ignorelist entries by network.
  • Add IGNORELIST_ONLY mode to generate only ignored tests, plus improved skipped-test reporting.
  • Update preprod/mainnet address-transactions fixtures (IDs/names and precached responses) to reflect paginated vs from/to cases.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
unit/index.test.ts Renames unit tests to use matchesIgnoreRule.
src/index.ts Implements ignorelist loading + IGNORELIST_ONLY gating and changes skipped-test logging.
src/config.ts Adds IGNORELIST_ONLY config and enforces NETWORK presence.
src/fixtures/preprod/addresses/address-transactions.ts Splits paginated vs from/to fixture cases and adds explicit responses.
src/fixtures/mainnet/addresses/address-transactions.ts Adds shared precached response data and renames/splits fixtures for paginated vs from/to variants.
Comments suppressed due to low confidence (1)

src/index.ts:29

  • envConfig is initialized at module load time via getConfig(). With the new NETWORK required check, importing this module will throw even for callers that only need pure functions (e.g. isUrlMatch). To avoid import-time crashes, consider deferring getConfig() (and ignorelist loading) until generateTestSuite / network-dependent code paths are invoked.
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const filePath = path.resolve(__dirname, '../endpoints-allowlist.json');
const ignorelistFilePath = path.resolve(__dirname, '../endpoints-ignorelist.json');

export const DEFAULT_TEST_TIMEOUT = 15_000;

const envConfig = getConfig();

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +199 to +201
const ignored = skippedTests.filter(t => t.reason.startsWith('On the ignorelist'));
const notInAllowlist = skippedTests.filter(t => !t.reason.startsWith('On the ignorelist'));

Comment on lines +219 to +223
lines.push(` Not in allowlist (${notInAllowlist.length}):`);

for (const t of notInAllowlist) {
lines.push(` ⊘ [${t.id}] ${t.testName} — ${t.endpoint}`);
}
Comment on lines +58 to +80
const loadIgnorelist = (filePath: string): IgnoreRule[] => {
if (!fs.existsSync(filePath)) {
return [];
}

if (fs.existsSync(blacklistFilePath)) {
try {
const rawData = fs.readFileSync(blacklistFilePath, 'utf8');
const network = envConfig.network;

try {
const rawData = fs.readFileSync(filePath, 'utf8');
const parsed: unknown = JSON.parse(rawData);

if (!Array.isArray(parsed)) {
throw new Error('Expected endpoints-blacklist.json to contain a JSON array.');
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
throw new Error(`Expected ${path.basename(filePath)} to be a JSON object keyed by network.`);
}

const entries = (parsed as Record<string, IgnoreRule[]>)[network];

if (!entries) {
return [];
}

if (!Array.isArray(entries)) {
throw new Error(`Expected ${path.basename(filePath)}["${network}"] to be an array.`);
Comment on lines +12 to 15
if (!network) {
throw new Error(`NETWORK env is not set.`);
}

Comment on lines 1 to 3
import { describe, expect, it } from 'vitest';
import { isUrlMatch, matchesBlacklistRule } from '../src/index.js';
import { isUrlMatch, matchesIgnoreRule } from '../src/index.js';
import { Fixture } from '../src/types/index.js';

if (!blacklisted && shouldRunTest(fixture)) {
// In IGNORELIST_ONLY mode, only run tests that are on the ignorelist.
// This is used by CI to verify blacklisted tests still fail.
@vladimirvolek
Copy link
Copy Markdown
Member Author

#63

@vladimirvolek vladimirvolek deleted the ignorelist-as-param branch April 2, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants