<commit_before>package scala.tools.nsc

import java.io.{File, IOException}
import java.nio.charset.Charset
import java.nio.file.attribute.BasicFileAttributes
import java.nio.file.{FileVisitResult, Files, Path, SimpleFileVisitor}

import org.junit.{After, Before, Test}

import scala.collection.JavaConverters._
import scala.collection.mutable
import FileUtils._
import scala.tools.nsc.PipelineMain._
import scala.tools.nsc.reporters.{ConsoleReporter, StoreReporter}

class PipelineMainTest {
  private var base: Path = _

  // Enables verbose output to console to help understand what the test is doing.
  private val debug = false
  private var deleteBaseAfterTest = true

  @Before def before(): Unit = {
    base = Files.createTempDirectory("pipelineBase")
  }

  @After def after(): Unit = {
    if (base != null && !debug && deleteBaseAfterTest) {
      deleteRecursive(base)
    }
  }

  private def projectsBase = createDir(base, "projects")

  @Test def pipelineMainBuildsSeparate(): Unit = {
    check(allBuilds.map(_.projects))
  }

  @Test def pipelineMainBuildsCombined(): Unit = {
    check(List(allBuilds.flatMap(_.projects)))
  }

  @Test def pipelineMainBuildsJavaAccessor(): Unit = {
    // Tests the special case in Typer:::canSkipRhs to make outline typing descend into method bodies might
    // give rise to super accssors
    check(List(b5SuperAccessor.projects), altStrategies = List(OutlineTypePipeline))
  }

  private val pipelineSettings = PipelineMain.defaultSettings.copy(
    useJars = true,
    parallelism = java.lang.Runtime.getRuntime.availableProcessors,
    cacheMacro = true,
    cachePlugin = true,
    stripExternalClassPath = true,
    useTraditionalForLeaf = true,
    createReporter = ((s: Settings) => if (debug) new ConsoleReporter(s) else new StoreReporter())
  )

  private def check(projectss: List[List[Build#Project]], altStrategies: List[BuildStrategy] = List(Pipeline, OutlineTypePipeline)): Unit = {
    def build(strategy: BuildStrategy): Unit = {
      for (projects <- projectss) {
        val argsFiles = projects.map(_.argsFile(Nil))
        val main = new PipelineMainClass(argsFiles, pipelineSettings.copy(strategy = strategy, logDir = Some(base.resolve(strategy.toString))))
        assert(main.process())
      }
    }
    build(Traditional)<commit_msg>Disable flaky tests for now<commit_after>package scala.tools.nsc

import java.io.{File, IOException}
import java.nio.charset.Charset
import java.nio.file.attribute.BasicFileAttributes
import java.nio.file.{FileVisitResult, Files, Path, SimpleFileVisitor}

import org.junit.{After, Before, Ignore, Test}

import scala.collection.JavaConverters._
import scala.collection.mutable
import FileUtils._
import scala.tools.nsc.PipelineMain._
import scala.tools.nsc.reporters.{ConsoleReporter, StoreReporter}

class PipelineMainTest {
  private var base: Path = _

  // Enables verbose output to console to help understand what the test is doing.
  private val debug = false
  private var deleteBaseAfterTest = true

  @Before def before(): Unit = {
    base = Files.createTempDirectory("pipelineBase")
  }

  @After def after(): Unit = {
    if (base != null && !debug && deleteBaseAfterTest) {
      deleteRecursive(base)
    }
  }

  private def projectsBase = createDir(base, "projects")

  @Ignore("scala/scala-dev#637")
  @Test def pipelineMainBuildsSeparate(): Unit = {
    check(allBuilds.map(_.projects))
  }

  @Ignore("scala/scala-dev#637")
  @Test def pipelineMainBuildsCombined(): Unit = {
    check(List(allBuilds.flatMap(_.projects)))
  }

  @Ignore("scala/scala-dev#637")
  @Test def pipelineMainBuildsJavaAccessor(): Unit = {
    // Tests the special case in Typer:::canSkipRhs to make outline typing descend into method bodies might
    // give rise to super accssors
    check(List(b5SuperAccessor.projects), altStrategies = List(OutlineTypePipeline))
  }

  private val pipelineSettings = PipelineMain.defaultSettings.copy(
    useJars = true,
    parallelism = java.lang.Runtime.getRuntime.availableProcessors,
    cacheMacro = true,
    cachePlugin = true,
    stripExternalClassPath = true,
    useTraditionalForLeaf = true,
    createReporter = ((s: Settings) => if (debug) new ConsoleReporter(s) else new StoreReporter())
  )

  private def check(projectss: List[List[Build#Project]], altStrategies: List[BuildStrategy] = List(Pipeline, OutlineTypePipeline)): Unit = {
    def build(strategy: BuildStrategy): Unit = {
      for (projects <- projectss) {
        val argsFiles = projects.map(_.argsFile(Nil))
        val main = new PipelineMainClass(argsFiles, pipelineSettings.copy(strategy = strategy, logDir = Some(base.resolve(strategy.toString))))
        assert(main.process())
      }
    }
    build(Traditional)
{'fraction_non_alphanumeric': 0.10760160033691303, 'fraction_numerical': 0.0023162771109707307, 'mean_word_length': 4.260243632336656, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6607568', 'n_tokens_mistral': 1440, 'n_tokens_neox': 1396, 'n_words': 345}