From 21938bf0b241ece4c98e2aa22842fecc52e34cac Mon Sep 17 00:00:00 2001 From: sophia Date: Tue, 20 Jul 2021 11:23:24 -0500 Subject: [PATCH] Update runner testdata --- internal/runner/accept_test.go | 17 +-- internal/runner/operation.go | 3 +- .../testdata/git-noop/DOTgit/COMMIT_EDITMSG | 9 +- .../runner/testdata/git-noop/DOTgit/index | Bin 145 -> 225 bytes .../runner/testdata/git-noop/DOTgit/logs/HEAD | 1 + .../git-noop/DOTgit/logs/refs/heads/master | 1 + .../b4/50d3da13b8f241226fca12ce3450b783d7038c | Bin 0 -> 87 bytes .../cf/a0599445d5025a7798f8949c83da3899e953df | Bin 0 -> 171 bytes .../ea/2549d66602a0a588e69f033c48944de5b7a45c | Bin 0 -> 85 bytes .../git-noop/DOTgit/refs/heads/master | 2 +- internal/runner/testdata/git-noop/Vagrantfile | 3 + .../git-noop/{waypoint.hcl => vagrant.hcl} | 0 internal/runner/testing.go | 124 ++++++++++++------ 13 files changed, 99 insertions(+), 61 deletions(-) create mode 100644 internal/runner/testdata/git-noop/DOTgit/objects/b4/50d3da13b8f241226fca12ce3450b783d7038c create mode 100644 internal/runner/testdata/git-noop/DOTgit/objects/cf/a0599445d5025a7798f8949c83da3899e953df create mode 100644 internal/runner/testdata/git-noop/DOTgit/objects/ea/2549d66602a0a588e69f033c48944de5b7a45c create mode 100644 internal/runner/testdata/git-noop/Vagrantfile rename internal/runner/testdata/git-noop/{waypoint.hcl => vagrant.hcl} (100%) diff --git a/internal/runner/accept_test.go b/internal/runner/accept_test.go index 6138f1a43..58e22d9b3 100644 --- a/internal/runner/accept_test.go +++ b/internal/runner/accept_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/require" + "github.com/hashicorp/vagrant/internal/core" "github.com/hashicorp/vagrant/internal/server/proto/vagrant_server" serverptypes "github.com/hashicorp/vagrant/internal/server/ptypes" "github.com/hashicorp/vagrant/internal/server/singleprocess" @@ -32,8 +33,8 @@ func TestRunnerAccept(t *testing.T) { runner := TestRunner(t, WithClient(client)) require.NoError(runner.Start()) - // Initialize our app - singleprocess.TestApp(t, client, serverptypes.TestJobNew(t, nil).Application) + // Initialize our basis + core.TestBasis(t) // Queue a job queueResp, err := client.QueueJob(ctx, &vagrant_server.QueueJobRequest{ @@ -60,8 +61,8 @@ func TestRunnerAccept_cancelContext(t *testing.T) { runner := TestRunner(t, WithClient(client)) require.NoError(runner.Start()) - // Initialize our app - singleprocess.TestApp(t, client, serverptypes.TestJobNew(t, nil).Application) + // Initialize our basis + core.TestBasis(t) // Set a blocker noopCh := make(chan struct{}) @@ -98,8 +99,8 @@ func TestRunnerAccept_cancelJob(t *testing.T) { runner := TestRunner(t, WithClient(client)) require.NoError(runner.Start()) - // Initialize our app - singleprocess.TestApp(t, client, serverptypes.TestJobNew(t, nil).Application) + // Initialize our basis + core.TestBasis(t) // Set a blocker noopCh := make(chan struct{}) @@ -149,8 +150,8 @@ func TestRunnerAccept_gitData(t *testing.T) { runner := TestRunner(t, WithClient(client)) require.NoError(runner.Start()) - // Initialize our app - singleprocess.TestApp(t, client, serverptypes.TestJobNew(t, nil).Application) + // Initialize our basis + core.TestBasis(t) // Queue a job queueResp, err := client.QueueJob(ctx, &vagrant_server.QueueJobRequest{ diff --git a/internal/runner/operation.go b/internal/runner/operation.go index c5b70b1a7..2d4b79b1c 100644 --- a/internal/runner/operation.go +++ b/internal/runner/operation.go @@ -99,7 +99,8 @@ func (r *Runner) executeJob( // Determine the evaluation context we'll be using log.Trace("reading configuration", "path", path) - cfg, err := configpkg.Load(path, filepath.Dir(path)) + pppp := filepath.Dir(path) + cfg, err := configpkg.Load(path, pppp) if err != nil { log.Warn("failed here trying to read configuration", "path", path) cfg = &configpkg.Config{} diff --git a/internal/runner/testdata/git-noop/DOTgit/COMMIT_EDITMSG b/internal/runner/testdata/git-noop/DOTgit/COMMIT_EDITMSG index 56f23a76c..d2473eea8 100644 --- a/internal/runner/testdata/git-noop/DOTgit/COMMIT_EDITMSG +++ b/internal/runner/testdata/git-noop/DOTgit/COMMIT_EDITMSG @@ -1,8 +1 @@ -Fixes -# Please enter the commit message for your changes. Lines starting -# with '#' will be ignored, and an empty message aborts the commit. -# -# On branch master -# Changes to be committed: -# modified: vagrant.hcl -# +Add Vagrantfile for testing diff --git a/internal/runner/testdata/git-noop/DOTgit/index b/internal/runner/testdata/git-noop/DOTgit/index index f8e85b688ed9f7eeb4957e63026c90f99ffc2788..2354e9290536adc064f436adebbf6aeff5c0ffe2 100644 GIT binary patch literal 225 zcmZ?q402{*U|<5_gs*?r3Y}d24n{LFFt9RtmzppzG%jIaVEhJDBLc*JuT(v+r72J`#4vD&C8if8=9Q#n=A;4@fdJ5)nQW?`!@#ui@&jP=>?YKqnI|Zr zpniXjP3rmSK4P5huP;U>t;}X);4Xuhr7~=;qpM>YxE}0IDCkrE=ysi_HZFhN Wyr4oY_G|n(A42YSH)KR7y#@eZ0w@Il diff --git a/internal/runner/testdata/git-noop/DOTgit/logs/HEAD b/internal/runner/testdata/git-noop/DOTgit/logs/HEAD index 9f7fbb439..5026d2438 100644 --- a/internal/runner/testdata/git-noop/DOTgit/logs/HEAD +++ b/internal/runner/testdata/git-noop/DOTgit/logs/HEAD @@ -1,2 +1,3 @@ 0000000000000000000000000000000000000000 1924b8606e1d56acb7e2059652ad059d4bac6f2e Mitchell Hashimoto 1597721732 -0700 commit (initial): Initial commit 1924b8606e1d56acb7e2059652ad059d4bac6f2e b6bf15100c570f2be6a231a095d395ed16dfed81 Mitchell Hashimoto 1597722255 -0700 commit: Fixes +b6bf15100c570f2be6a231a095d395ed16dfed81 cfa0599445d5025a7798f8949c83da3899e953df sophia 1626733782 -0500 commit: Add Vagrantfile for testing diff --git a/internal/runner/testdata/git-noop/DOTgit/logs/refs/heads/master b/internal/runner/testdata/git-noop/DOTgit/logs/refs/heads/master index 9f7fbb439..5026d2438 100644 --- a/internal/runner/testdata/git-noop/DOTgit/logs/refs/heads/master +++ b/internal/runner/testdata/git-noop/DOTgit/logs/refs/heads/master @@ -1,2 +1,3 @@ 0000000000000000000000000000000000000000 1924b8606e1d56acb7e2059652ad059d4bac6f2e Mitchell Hashimoto 1597721732 -0700 commit (initial): Initial commit 1924b8606e1d56acb7e2059652ad059d4bac6f2e b6bf15100c570f2be6a231a095d395ed16dfed81 Mitchell Hashimoto 1597722255 -0700 commit: Fixes +b6bf15100c570f2be6a231a095d395ed16dfed81 cfa0599445d5025a7798f8949c83da3899e953df sophia 1626733782 -0500 commit: Add Vagrantfile for testing diff --git a/internal/runner/testdata/git-noop/DOTgit/objects/b4/50d3da13b8f241226fca12ce3450b783d7038c b/internal/runner/testdata/git-noop/DOTgit/objects/b4/50d3da13b8f241226fca12ce3450b783d7038c new file mode 100644 index 0000000000000000000000000000000000000000..f413133e0a3ccc587cf5f05cb57bf80b714bbdf8 GIT binary patch literal 87 zcmV-d0I2_X0V^p=O;s?rU@$Z=Ff%bx2un;aO3W)s%gjk-c%|xjEsbfx(vD~InQc6# t_&(jfBnGOi45CagBRPjbLP7oh9Gleh(|yD^+h1RdOj?=E1^_1)ANl_rC6E9B literal 0 HcmV?d00001 diff --git a/internal/runner/testdata/git-noop/DOTgit/objects/cf/a0599445d5025a7798f8949c83da3899e953df b/internal/runner/testdata/git-noop/DOTgit/objects/cf/a0599445d5025a7798f8949c83da3899e953df new file mode 100644 index 0000000000000000000000000000000000000000..3d6d18f1a2af74f69ba204f0d590f51a46eafcab GIT binary patch literal 171 zcmV;c095~Y0iBLpYQ!)M0QcLc@CCZaQv3)krM*P|WlPQ)^1^ZN-<+YpGYm{Qwyh0| z6Fx>)wR!R&B?(Ck%Q zkgAfL;otE-y1kC`-Ppda!q?Ds<=*z$e=Qrg^;wSX)4G5m62*k}13ZAa>Ag7gU$OZX Zu|K?Y-bZb#+Imk6y++#?^9QHNO^Q`fT9yC+ literal 0 HcmV?d00001 diff --git a/internal/runner/testdata/git-noop/DOTgit/objects/ea/2549d66602a0a588e69f033c48944de5b7a45c b/internal/runner/testdata/git-noop/DOTgit/objects/ea/2549d66602a0a588e69f033c48944de5b7a45c new file mode 100644 index 0000000000000000000000000000000000000000..d5cf29b376b6f567584084646a71b785aeb83cbd GIT binary patch literal 85 zcmV-b0IL6Z0ZYosPf{?qU