testng-parallel
БесплатноБез исполняемых скриптовНе проверенUse when configuring parallel test execution with TestNG including thread pools, suite configuration, and synchronization.
от TheBushidoCollective★ 202 звезды на GitHubОб этом скилле
TestNG Parallel Execution
Master TestNG parallel test execution including thread pool configuration, suite-level parallelism, method-level parallelism, and thread safety patterns. This skill covers techniques for maximizing test throughput while maintaining test reliability.
Overview
TestNG supports parallel execution at multiple levels: suite, test, class, and method. Proper parallel configuration can significantly reduce test execution time, but requires careful consideration of thread safety and resource management.
Parallel Execution Modes
Suite-Level Parallelism
Run multiple <test> tags in parallel:
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Parallel Suite" parallel="tests" thread-count="3">
<test name="Chrome Tests">
<classes>
<class name="com.example.tests.BrowserTest"/>
</classes>
</test>
<test name="Firefox Tests">
<classes>
<class name="com.example.tests.BrowserTest"/>
</classes>
</test>
<test name="Safari Tests">
<classes>
<class name="com.example.tests.BrowserTest"/>
</classes>
</test>
</suite>
Class-Level Parallelism
Run test classes in parallel:
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Parallel Classes" parallel="classes" thread-count="4">
<test name="All Tests">
<classes>
<class name="com.example.tests.UserServiceTest"/>
<class name="com.example.tests.ProductServiceTest"/>
<class name="com.example.tests.OrderServiceTest"/>
<class name="com.example.tests.PaymentServiceTest"/>
</classes>
</test>
</suite>
Method-Level Parallelism
Run test methods in parallel:
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Parallel Methods" parallel="methods" thread-count="5">
<test name="Service Tests">
<classes>
<class name="com.example.tests.IndependentMethodsTest"/>
</classes>
</test>
</suite>
Instance-Level Parallelism
Run test instances in parallel (useful with Factory):
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Parallel Instances" parallel="instances" thread-count="3">
<test name="Factory Tests">
<classes>
<class name="com.example.tests.FactoryGeneratedTest"/>
</classes>
</test>
</suite>
Thread Pool Configuration
Basic Thread Configuration
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Thread Pool Suite" parallel="methods" thread-count="10">
<!-- Global thread pool configuration -->
<test name="Test Group 1" thread-count="5">
<!-- Override for this specific test -->
<classes>
<class name="com.example.tests.Test1"/>
</classes>
</test>
<test name="Test Group 2">
<!-- Uses suite-level thread-count -->
<classes>
<class name="com.example.tests.Test2"/>
</classes>
</test>
</suite>
Data Provider Parallel Execution
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="DataProvider Suite" data-provider-thread-count="20">
<test name="Data Driven Tests">
<classes>
<class name="com.example.tests.ParallelDataProviderTest"/>
</classes>
</test>
</suite>
public class ParallelDataProviderTest {
@DataProvider(name = "largeDataSet", parallel = true)
public Object[][] provideLargeDataSet() {
Object[][] data = new Object[100][2];
for (int i = 0; i < 100; i++) {
data[i] = new Object[]{"User" + i, "user" + i + "@example.com"};
}
return data;
}
@Test(dataProvider = "largeDataSet")
public void testWithParallelData(String name, String email) {
System.out.println(Thread.currentThread().getName() + " - Testing: " + name);
// Each data row runs in parallel
}
}
Thread Safety Patterns
Thread-Local Storage
import org.testng.annotations.*;
public class ThreadLocalTest {
// Thread-local storage for test-specific resources
private static ThreadLocal<WebDriver> driverThread = new ThreadLocal<>();
private static ThreadLocal<String> sessionThread = new ThreadLocal<>();
@BeforeMethod
public void setUp() {
// Initialize thread-local resources
driverThread.set(createWebDriver());
sessionThread.set(generateSessionId());
}
@AfterMethod
public void tearDown() {
// Clean up thread-local resources
WebDriver driver = driverThread.get();
if (driver != null) {
driver.quit();
}
driverThread.remove();
sessionThread.remove();
}
@Test
public void testParallelBrowser() {
WebDriver driver = driverThread.get();
String session = se
Установить testng-parallel в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGlobGrepFAQ
Что делает скилл testng-parallel?
Use when configuring parallel test execution with TestNG including thread pools, suite configuration, and synchronization.
Как установить скилл testng-parallel?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл testng-parallel запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic