Skip to content

Commit

Permalink
cleanup(pam/integration-tests/cli): Do not build the module and pam c…
Browse files Browse the repository at this point in the history
…lients for each test (#409)

Since commit d1a75d8, for the cli tests we call prepareClientTest()
for each test in order to get the client folder, however this also
implies building the test client, the module and the exec client for
each test even though this is not needed, since we can share those
binaries.

So just call this once in the main test.

Ideally this should make CI a little quicker.
  • Loading branch information
3v1n0 committed Jul 3, 2024
2 parents d3d60d3 + 4d26596 commit d000437
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pam/integration-tests/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ func TestCLIAuthenticate(t *testing.T) {
currentDir, err := os.Getwd()
require.NoError(t, err, "Setup: Could not get current directory for the tests")

clientPath := t.TempDir()
cliEnv := prepareClientTest(t, clientPath)

tests := map[string]struct {
tape string

Expand Down Expand Up @@ -71,8 +74,10 @@ func TestCLIAuthenticate(t *testing.T) {
t.Parallel()

outDir := t.TempDir()
err := os.Symlink(filepath.Join(clientPath, "pam_authd"),
filepath.Join(outDir, "pam_authd"))
require.NoError(t, err, "Setup: symlinking the pam client")

cliEnv := prepareClientTest(t, outDir)
cliLog := prepareCLILogging(t)
t.Cleanup(func() {
saveArtifactsForDebug(t, []string{
Expand Down

0 comments on commit d000437

Please sign in to comment.