Search in sources :

Example 11 with ProcessResult

use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.

the class AuditDependenciesCommandIntegrationTest method testOutputWithoutDuplicates.

@Test
public void testOutputWithoutDuplicates() throws IOException {
    ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "audit_dependencies", tmp);
    workspace.setUp();
    // Print all of the inputs to the rule.
    ProcessResult result = workspace.runBuckCommand("audit", "dependencies", "//example:two", "//example:three");
    result.assertSuccess();
    assertEquals(workspace.getFileContents("stdout-two-three"), result.getStdout());
}
Also used : ProjectWorkspace(com.facebook.buck.testutil.integration.ProjectWorkspace) ProcessResult(com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult) Test(org.junit.Test)

Example 12 with ProcessResult

use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.

the class BuckConfigTest method testBuckPyIgnorePaths.

@Test
public void testBuckPyIgnorePaths() throws IOException {
    ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "buck_py_ignore_paths", temporaryFolder);
    workspace.setUp();
    ProcessResult result = workspace.runBuckCommand("test", "--all");
    result.assertSuccess("buck test --all should exit cleanly");
}
Also used : ProjectWorkspace(com.facebook.buck.testutil.integration.ProjectWorkspace) ProcessResult(com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult) Test(org.junit.Test)

Example 13 with ProcessResult

use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.

the class AuditDependenciesCommandIntegrationTest method testDirectDependenciesIncludesExtraDependencies.

@Test
public void testDirectDependenciesIncludesExtraDependencies() throws IOException {
    ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "audit_dependencies", tmp);
    workspace.setUp();
    // Print all of the inputs to the rule.
    ProcessResult result = workspace.runBuckCommand("audit", "dependencies", "//example:app-target");
    result.assertSuccess();
    assertEquals(workspace.getFileContents("stdout-app-target-extra-deps"), result.getStdout());
}
Also used : ProjectWorkspace(com.facebook.buck.testutil.integration.ProjectWorkspace) ProcessResult(com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult) Test(org.junit.Test)

Example 14 with ProcessResult

use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.

the class AuditDependenciesCommandIntegrationTest method testImmediateDependencies.

@Test
public void testImmediateDependencies() throws IOException {
    ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "audit_dependencies", tmp);
    workspace.setUp();
    // Print all of the inputs to the rule.
    ProcessResult result = workspace.runBuckCommand("audit", "dependencies", "//example:one");
    result.assertSuccess();
    assertEquals(workspace.getFileContents("stdout-one"), result.getStdout());
}
Also used : ProjectWorkspace(com.facebook.buck.testutil.integration.ProjectWorkspace) ProcessResult(com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult) Test(org.junit.Test)

Example 15 with ProcessResult

use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.

the class AuditDependenciesCommandIntegrationTest method testTestFlagWithTransitiveShowsAllTests.

@Test
public void testTestFlagWithTransitiveShowsAllTests() throws IOException {
    ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "audit_dependencies", tmp);
    workspace.setUp();
    // Print all of the inputs to the rule.
    ProcessResult result = workspace.runBuckCommand("audit", "dependencies", "--include-tests", "--transitive", "//example:one");
    result.assertSuccess();
    assertEquals(workspace.getFileContents("stdout-one-transitive-tests"), result.getStdout());
}
Also used : ProjectWorkspace(com.facebook.buck.testutil.integration.ProjectWorkspace) ProcessResult(com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult) Test(org.junit.Test)

Aggregations

ProcessResult (com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult)175 Test (org.junit.Test)174 ProjectWorkspace (com.facebook.buck.testutil.integration.ProjectWorkspace)127 Path (java.nio.file.Path)21 Matchers.containsString (org.hamcrest.Matchers.containsString)20 BuildTarget (com.facebook.buck.model.BuildTarget)17 JsonNode (com.fasterxml.jackson.databind.JsonNode)8 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)8 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)6 TestContext (com.facebook.buck.testutil.integration.TestContext)4 ProjectFilesystem (com.facebook.buck.io.ProjectFilesystem)3 ZipInspector (com.facebook.buck.testutil.integration.ZipInspector)3 ZipFile (java.util.zip.ZipFile)3 FakeProjectFilesystem (com.facebook.buck.testutil.FakeProjectFilesystem)2 DelegatingInputStream (com.facebook.buck.testutil.integration.DelegatingInputStream)2 CapturingPrintStream (com.facebook.buck.util.CapturingPrintStream)2 File (java.io.File)2 Charset (java.nio.charset.Charset)2 FileTime (java.nio.file.attribute.FileTime)2 ArtifactCache (com.facebook.buck.artifact_cache.ArtifactCache)1