(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:CURRENT_DIR)
          op: Equal
          rhs: 
            {
              (DQ 
                (CommandSubPart
                  command_list: 
                    (CommandList
                      children: [
                        (AndOr
                          children: [
                            (C {(cd)} 
                              {
                                (DQ 
                                  (CommandSubPart
                                    command_list: 
                                      (CommandList
                                        children: [
                                          (C {(dirname)} 
                                            {
                                              (DQ 
                                                (BracedVarSub
                                                  token: <VSub_Name BASH_SOURCE>
                                                  bracket_op: 
                                                    (ArrayIndex
                                                      expr: (ArithWord w:{(Lit_Digits 0)})
                                                    )
                                                  spids: [59 64]
                                                )
                                              )
                                            }
                                          )
                                        ]
                                      )
                                    left_token: <Left_CommandSub "$(">
                                    spids: [55 66]
                                  )
                                )
                              }
                            )
                            (C {(pwd)})
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                    )
                  left_token: <Left_CommandSub "$(">
                  spids: [51 72]
                )
              )
            }
          spids: [49]
        )
      ]
      spids: [49]
    )
    (AndOr
      children: [
        (C {(source)} {(DQ (${ VSub_Name CURRENT_DIR) (/../integration_test_setup.sh))})
        (BraceGroup
          children: [
            (Sentence
              child: 
                (SimpleCommand
                  words: [{(echo)} {(DQ ("integration_test_setup.sh not found!"))}]
                  redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[96])]
                )
              terminator: <Op_Semi ";">
            )
            (Sentence child:(C {(exit)} {(1)}) terminator:<Op_Semi ";">)
          ]
          spids: [88]
        )
      ]
      op_id: Op_DPipe
    )
    (C {(add_to_bazelrc)} {(DQ ("test --nocache_test_results"))})
    (FuncDef
      name: create_test_files
      body: 
        (BraceGroup
          children: [
            (C {(touch)} {($ VSub_Name "$TEST_TMPDIR") (/counter)})
            (C {(mkdir)} {(dir)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("#!/bin/sh\n") ("# hard link\n") ("z=") ($ VSub_Name "$TEST_TMPDIR") (/) 
                        (EscapedLiteralPart token:<Lit_EscapedChar "\\$">) ("(basename ") (EscapedLiteralPart token:<Lit_EscapedChar "\\$">) ("(mktemp -u))\n") ("ln ") 
                        ($ VSub_Name "$TEST_TMPDIR") ("/counter ") (EscapedLiteralPart token:<Lit_EscapedChar "\\$">) ("{z}\n") ("\n") 
                        ("# Make sure other test runs have started too.\n") ("sleep 1\n") ("nlink=") (EscapedLiteralPart token:<Lit_EscapedChar "\\$">) ("(ls -l ") 
                        ($ VSub_Name "$TEST_TMPDIR") ("/counter | awk '{print ") (EscapedLiteralPart token:<Lit_EscapedChar "\\$">) ("2}')\n") ("\n") 
                        ("# 4 links = 3 jobs + ") ($ VSub_Name "$TEST_TMPDIR") ("/counter\n") ("if [[ ") (Right_DoubleQuote "\"") 
                        (EscapedLiteralPart token:<Lit_EscapedChar "\\$">) (nlink) (Right_DoubleQuote "\"") (" -gt 4 ]] ; then\n") ("  echo found ") (Right_DoubleQuote "\"") 
                        (EscapedLiteralPart token:<Lit_EscapedChar "\\$">) (nlink) (Right_DoubleQuote "\"") (" hard links to file, want 4 max.\n") ("  exit 1\n") ("fi\n") ("\n") 
                        (
"# Ensure that we don't remove before other runs have inspected the file.\n"
                        ) ("sleep 1\n") ("rm ") (EscapedLiteralPart token:<Lit_EscapedChar "\\$">) ("{z}\n") ("\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [151]
                )
                (Redir op_id:Redir_Great fd:-1 arg_word:{(dir/test.sh)} spids:[154])
              ]
            )
            (C {(chmod)} {(Lit_Other "+") (x)} {(dir/test.sh)})
            (SimpleCommand
              words: [{(cat)}]
              redirects: [
                (HereDoc
                  op_id: Redir_DLess
                  fd: -1
                  body: 
                    {
                      (DQ ("sh_test(\n") ("  name = ") (Right_DoubleQuote "\"") (test) 
                        (Right_DoubleQuote "\"") (",\n") ("  srcs = [ ") (Right_DoubleQuote "\"") (test.sh) (Right_DoubleQuote "\"") (" ],\n") ("  size = ") 
                        (Right_DoubleQuote "\"") (small) (Right_DoubleQuote "\"") (",\n") ("  tags = [ ") (Right_DoubleQuote "\"") (local) 
                        (Right_DoubleQuote "\"") (" ],\n") (")\n")
                      )
                    }
                  do_expansion: True
                  here_end: EOF
                  was_filled: True
                  spids: [220]
                )
                (Redir op_id:Redir_Great fd:-1 arg_word:{(dir/BUILD)} spids:[223])
              ]
            )
          ]
          spids: [125]
        )
      spids: [119 124]
    )
    (FuncDef
      name: test_local_test_jobs_constrains_test_execution
      body: 
        (BraceGroup
          children: [
            (C {(create_test_files)})
            (C {(bazel)} {(test)} {(--local_test_jobs) (Lit_Other "=") (3)} 
              {(--local_resources) (Lit_Other "=") (10000) (Lit_Comma ",") (10) (Lit_Comma ",") (100)} {(--runs_per_test) (Lit_Other "=") (10)} {(//dir) (Lit_Other ":") (test)}
            )
          ]
          spids: [258]
        )
      spids: [252 257]
    )
    (FuncDef
      name: test_no_local_test_jobs_causes_local_resources_to_constrain_test_execution
      body: 
        (BraceGroup
          children: [
            (C {(create_test_files)})
            (C {(bazel)} {(test)} 
              {(--local_resources) (Lit_Other "=") (10000) (Lit_Comma ",") (3) (Lit_Comma ",") (100)} {(--runs_per_test) (Lit_Other "=") (10)} {(//dir) (Lit_Other ":") (test)}
            )
          ]
          spids: [303]
        )
      spids: [297 302]
    )
    (FuncDef
      name: test_local_test_jobs_exceeds_jobs_causes_warning
      body: 
        (BraceGroup
          children: [
            (C {(create_test_files)})
            (SimpleCommand
              words: [
                {(bazel)}
                {(test)}
                {(--jobs) (Lit_Other "=") (3)}
                {(--local_test_jobs) (Lit_Other "=") (10)}
                {(--local_resources) (Lit_Other "=") (10000) (Lit_Comma ",") (10) (Lit_Comma ",") (100)}
                {(--runs_per_test) (Lit_Other "=") (10)}
                {(//dir) (Lit_Other ":") (test)}
              ]
              redirects: [
                (Redir
                  op_id: Redir_GreatAnd
                  fd: -1
                  arg_word: {($ VSub_Name "$TEST_log")}
                  spids: [384]
                )
              ]
            )
            (C {(expect_log)} {(SQ <"High value for --local_test_jobs">)})
          ]
          spids: [344]
        )
      spids: [338 343]
    )
    (FuncDef
      name: test_negative_local_test_jobs_causes_warning
      body: 
        (BraceGroup
          children: [
            (C {(create_test_files)})
            (AndOr
              children: [
                (SimpleCommand
                  words: [
                    {(bazel)}
                    {(test)}
                    {(--local_test_jobs) (Lit_Other "=") (-1)}
                    {(--local_resources) (Lit_Other "=") (10000) (Lit_Comma ",") (10) (Lit_Comma ",") 
                      (100)
                    }
                    {(--runs_per_test) (Lit_Other "=") (10)}
                    {(//dir) (Lit_Other ":") (test)}
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_GreatAnd
                      fd: -1
                      arg_word: {($ VSub_Name "$TEST_log")}
                      spids: [437]
                    )
                  ]
                )
                (C {(fail)} {(DQ ("Expected test failure"))})
              ]
              op_id: Op_DAmp
            )
            (C {(expect_log)} {(SQ <"Invalid parameter for --local_test_jobs">)})
          ]
          spids: [405]
        )
      spids: [399 404]
    )
    (C {(run_suite)} {(DQ ("Tests for --local_test_jobs option."))})
  ]
)