This project is mirrored from https://:*****@github.com/hashicorp/terraform.git. Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
  1. 19 Nov, 2018 4 commits
    • Martin Atkins's avatar
      command: Fix TestMetaBackend_configureNewWithState · aacbe1d1
      Martin Atkins authored
      This test was initially failing because its fixture had a state which our
      new state models consider to be "empty", and thus it was not migrated.
      
      After fixing that (by adding an output to the fixture), this revealed a
      bug that the lineage was not being persisted through the migration. This
      is fixed by using the statemgr.Migrate method instead of writing via the
      normal Writer interface, which allows two cooperating state managers to
      properly transfer the lineage and serial along with the state snapshot.
      aacbe1d1
    • Martin Atkins's avatar
    • Martin Atkins's avatar
      states/statemgr: Migrate, Import, and Export functions · 94510bc1
      Martin Atkins authored
      In our recent refactoring of the state manager interfaces we made serial
      and lineage management the responsibility of the state managers
      themselves, not exposing them at all to most callers, and allowing for
      simple state managers that don't implement them at all.
      
      However, we do have some specific cases where we need to preserve these
      properly when available, such as migration between backends, and the
      "terraform state push" and "terraform state pull" commands.
      
      These new functions and their associated optional interface allow the
      logic here to be captured in one place and access via some simple
      calls. Separating this from the main interface leaves things simple for
      the normal uses of state managers.
      
      Since these functions are mostly just thin wrappers around other
      functionality, they are not yet well-tested directly, but will be
      indirectly tested through the tests of their callers. A subsequent commit
      will add more unit tests here.
      94510bc1
    • Martin Atkins's avatar
      command: Fix TestMetaBackend_emptyWithExplicitState · 22933912
      Martin Atkins authored
      This test was incorrectly updated in a previous iteration, with it
      creating a modified state to write but then not actually writing it,
      writing an empty test state instead.
      
      This made the test fail because a backup state file is created only if
      the new state snapshot is different to the old when written.
      22933912
  2. 17 Nov, 2018 1 commit
  3. 16 Nov, 2018 15 commits
  4. 15 Nov, 2018 8 commits
  5. 13 Nov, 2018 9 commits
  6. 12 Nov, 2018 3 commits
    • Martin Atkins's avatar
      command: TestInit_fromModule_explicitDest guard against other tests · 8c54da0a
      Martin Atkins authored
      Some other test is leaving behind a terraform.tfstate after it concludes,
      which can cause this test to fail in a strange way due to picking up
      extra provider requirements from that state.
      
      This check doesn't fix that problem, but it at least makes the test fail
      in a more helpful way to avoid time wasted trying to debug this test when
      it's some other test that actually has the bug.
      8c54da0a
    • Martin Atkins's avatar
      command: fix panic in TestStatePush_lineageMismatch · ced06a4c
      Martin Atkins authored
      This test is currently failing due to the command completing successfully,
      which would previously cause a panic because we didn't properly initialize
      the MockUi and so its error buffer is nil unless written to.
      
      (The failure this was masking will be fixed in a subsequent commit.)
      ced06a4c
    • Martin Atkins's avatar
      command: Fix TestInit_checkRequiredVersion · 544c2932
      Martin Atkins authored
      In prior refactoring we lost the required core version check from
      "terraform init", which we restore here.
      
      Additionally, this test used to have an incorrect name that suggested it
      was testing something in the "getProvider" codepath, but version checking
      happens regardless of what other options are selected.
      544c2932