Search in sources :

Example 1 with EnvVarVerifier

use of jenkins.plugins.nodejs.VerifyEnvVariableBuilder.EnvVarVerifier in project nodejs-plugin by jenkinsci.

the class NodeJSCommandInterpreterTest method test_set_of_cache_location.

@Test
public void test_set_of_cache_location() throws Exception {
    final File cacheFolder = folder.newFolder();
    NodeJSInstallation installation = mockInstaller();
    NodeJSCommandInterpreter builder = CIBuilderHelper.createMock("test_creation_of_config", installation);
    builder.setCacheLocationStrategy(new TestCacheLocationLocator(cacheFolder));
    FreeStyleProject job = j.createFreeStyleProject("cache");
    job.getBuildersList().add(builder);
    job.getBuildersList().add(new EnvVarVerifier(NodeJSConstants.NPM_CACHE_LOCATION, cacheFolder.getAbsolutePath()));
    j.assertBuildStatusSuccess(job.scheduleBuild2(0));
}
Also used : NodeJSInstallation(jenkins.plugins.nodejs.tools.NodeJSInstallation) EnvVarVerifier(jenkins.plugins.nodejs.VerifyEnvVariableBuilder.EnvVarVerifier) FreeStyleProject(hudson.model.FreeStyleProject) File(java.io.File) Test(org.junit.Test)

Example 2 with EnvVarVerifier

use of jenkins.plugins.nodejs.VerifyEnvVariableBuilder.EnvVarVerifier in project nodejs-plugin by jenkinsci.

the class NodeJSBuildWrapperTest method test_set_of_cache_location.

@Test
public void test_set_of_cache_location() throws Exception {
    FreeStyleProject job = j.createFreeStyleProject("cache");
    final File cacheFolder = fileRule.newFolder();
    NodeJSBuildWrapper bw = mockWrapper(mockInstaller());
    bw.setCacheLocationStrategy(new TestCacheLocationLocator(cacheFolder));
    job.getBuildWrappersList().add(bw);
    job.getBuildersList().add(new EnvVarVerifier(NodeJSConstants.NPM_CACHE_LOCATION, cacheFolder.getAbsolutePath()));
    j.assertBuildStatusSuccess(job.scheduleBuild2(0));
}
Also used : EnvVarVerifier(jenkins.plugins.nodejs.VerifyEnvVariableBuilder.EnvVarVerifier) FreeStyleProject(hudson.model.FreeStyleProject) File(java.io.File) Test(org.junit.Test)

Aggregations

FreeStyleProject (hudson.model.FreeStyleProject)2 File (java.io.File)2 EnvVarVerifier (jenkins.plugins.nodejs.VerifyEnvVariableBuilder.EnvVarVerifier)2 Test (org.junit.Test)2 NodeJSInstallation (jenkins.plugins.nodejs.tools.NodeJSInstallation)1