go.temporal.io/server/tests/testutils/io.go

34 LOC · 18 covered · 16 uncovered · 2 ranges · 58 concepts · 2 introducers · 43 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the fileTestUpdateSchema · 0 introduced LOCTestUpdateSchemaTestUpdateSchema · 0 introduced LOCTestUpdateSchemaTestUpdateSchema · 0 introduced LOCTestUpdateSchemaupdate_task_tests.go ×1 · 6 introduced LOCupdate_task_tests.go ×1update_task_tests.go ×1 · 6 introduced LOCupdate_task_tests.go ×1TestSetupSchema · 0 introduced LOCTestSetupSchemaTestSetupSchema · 0 introduced LOCTestSetupSchemaTestSetupSchema · 0 introduced LOCTestSetupSchemahandler.go ×1 · 8 introduced LOChandler.go ×1setuptest.go ×1 · 11 introduced LOCsetuptest.go ×1updatetest.go ×3 · 74 introduced LOCupdatetest.go ×3TestParseCQLFile · 0 introduced LOCTestParseCQLFileTestParseCQLFile · 0 introduced LOCTestParseCQLFileTestParseCQLFile · 0 introduced LOCTestParseCQLFilecqlclient_tests.go ×1 · 3 introduced LOCcqlclient_tests.go ×1setuptest.go ×4 · 84 introduced LOCsetuptest.go ×4cqlclient_tests.go ×1 · 34 introduced LOCcqlclient_tests.go ×1conn_tests.go ×1 · 3 introduced LOCconn_tests.go ×1setuptest.go ×1 · 10 introduced LOCsetuptest.go ×1visibility_archiver.go ×1 · 1 introduced LOCvisibility_archiver.go ×…query_parser.go ×1 · 4 introduced LOCquery_parser.go ×1TestArchiveAndGet · 0 introduced LOCTestArchiveAndGetdbtest.go ×1 · 10 introduced LOCdbtest.go ×1io.go ×1 · 9 introduced LOCio.go ×1TestArchive_Success · 0 introduced LOCTestArchive_Successhistory_archiver.go ×4 · 8 introduced LOChistory_archiver.go ×4visibility_archiver.go ×4 · 7 introduced LOCvisibility_archiver.go ×…env->env+zone_combined, just_base.yaml_env_and_zone_defined, +3 · 0 introduced LOCenv->env+zone_combined, …base.yaml_and_development.yaml_and_development_zone.yaml · 0 introduced LOCbase.yaml_and_developmen…loader.go ×3 · 8 introduced LOCloader.go ×3just_base.yaml · 0 introduced LOCjust_base.yamlbase.yaml_and_development.yaml · 0 introduced LOCbase.yaml_and_developmen…TestReadSchemaDir · 0 introduced LOCTestReadSchemaDirloader.go ×1 · 3 introduced LOCloader.go ×1static_config_without_template · 0 introduced LOCstatic_config_without_te…loader.go ×1 · 2 introduced LOCloader.go ×1updatetask.go ×1 · 2 introduced LOCupdatetask.go ×1TestReadSchemaDirEFS · 0 introduced LOCTestReadSchemaDirEFSupdatetask.go ×1 · 1 introduced LOCupdatetask.go ×1loader.go ×8 · 16 introduced LOCloader.go ×8updatetask.go ×1 · 2 introduced LOCupdatetask.go ×1updatetask.go ×1 · 9 introduced LOCupdatetask.go ×1util.go ×1 · 2 introduced LOCutil.go ×1util.go ×2 · 3 introduced LOCutil.go ×2updatetask.go ×1 · 2 introduced LOCupdatetask.go ×1updatetask.go ×1 · 1 introduced LOCupdatetask.go ×1util.go ×1 · 2 introduced LOCutil.go ×1TestReadFile · 0 introduced LOCTestReadFileutil.go ×1 · 2 introduced LOCutil.go ×1updatetask.go ×3 · 6 introduced LOCupdatetask.go ×3TestMkdirAll · 0 introduced LOCTestMkdirAllutil.go ×1 · 2 introduced LOCutil.go ×1util.go ×1 · 3 introduced LOCutil.go ×1updatetask.go ×1 · 1 introduced LOCupdatetask.go ×1updatetask.go ×3 · 7 introduced LOCupdatetask.go ×3updatetask.go ×1 · 2 introduced LOCupdatetask.go ×1zap_logger.go ×1 · 2 introduced LOCzap_logger.go ×1io.go ×1 · 9 introduced LOCio.go ×1TestArchiveAndGet · introduced test · go.temporal.io/server/common/archiver/filestore/TestHistoryArchiverSuite/TestArchiveAndGetTestArchiveAndGetTestArchive_Success · introduced test · go.temporal.io/server/common/archiver/filestore/TestHistoryArchiverSuite/TestArchive_SuccessTestArchive_SuccessTestDirectoryExists · introduced test · go.temporal.io/server/common/archiver/filestore/TestUtilSuite/TestDirectoryExistsTestDirectoryExistsTestFileExists · introduced test · go.temporal.io/server/common/archiver/filestore/TestUtilSuite/TestFileExistsTestFileExistsTestListFilesByPrefix · introduced test · go.temporal.io/server/common/archiver/filestore/TestUtilSuite/TestListFilesByPrefixTestListFilesByPrefixTestMkdirAll · introduced test · go.temporal.io/server/common/archiver/filestore/TestUtilSuite/TestMkdirAllTestMkdirAllTestReadFile · introduced test · go.temporal.io/server/common/archiver/filestore/TestUtilSuite/TestReadFileTestReadFileTestValidateDirPath · introduced test · go.temporal.io/server/common/archiver/filestore/TestUtilSuite/TestValidateDirPathTestValidateDirPathTestWriteFile · introduced test · go.temporal.io/server/common/archiver/filestore/TestUtilSuite/TestWriteFileTestWriteFileTestArchiveAndQuery · introduced test · go.temporal.io/server/common/archiver/filestore/TestVisibilityArchiverSuite/TestArchiveAndQueryTestArchiveAndQueryTestArchive_Success · introduced test · go.temporal.io/server/common/archiver/filestore/TestVisibilityArchiverSuite/TestArchive_SuccessTestArchive_SuccessTestQuery_EmptyQuery_Pagination · introduced test · go.temporal.io/server/common/archiver/filestore/TestVisibilityArchiverSuite/TestQuery_EmptyQuery_PaginationTestQuery_EmptyQuery_Pag…invalid_yaml_returns_error · introduced test · go.temporal.io/server/common/config/TestLoad/invalid_yaml_returns_errorinvalid_yaml_returns_err…static_config_without_template · introduced test · go.temporal.io/server/common/config/TestLoad/static_config_without_templatestatic_config_without_te…template_config_with_file_path_uses_system_env_vars · introduced test · go.temporal.io/server/common/config/TestLoad/template_config_with_file_path_uses_system_env_varstemplate_config_with_fil…base.yaml_and_development.yaml · introduced test · go.temporal.io/server/common/config/TestPathResolution/base.yaml_and_development.yamlbase.yaml_and_developmen…base.yaml_and_development.yaml_and_development_zone.yaml · introduced test · go.temporal.io/server/common/config/TestPathResolution/base.yaml_and_development.yaml_and_development_zone.yamlbase.yaml_and_developmen…base.yaml_and_development.yaml_and_development_zone.yaml#01 · introduced test · go.temporal.io/server/common/config/TestPathResolution/base.yaml_and_development.yaml_and_development_zone.yaml#01base.yaml_and_developmen…base.yaml_and_prod_east.yaml_env_and_zone_defined · introduced test · go.temporal.io/server/common/config/TestPathResolution/base.yaml_and_prod_east.yaml_env_and_zone_definedbase.yaml_and_prod_east.…env->env+zone_combined · introduced test · go.temporal.io/server/common/config/TestPathResolution/env->env+zone_combinedenv->env+zone_combinedjust_base.yaml · introduced test · go.temporal.io/server/common/config/TestPathResolution/just_base.yamljust_base.yamljust_base.yaml_env_and_zone_defined · introduced test · go.temporal.io/server/common/config/TestPathResolution/just_base.yaml_env_and_zone_definedjust_base.yaml_env_and_z…prod_east.yaml_env_and_zone_defined · introduced test · go.temporal.io/server/common/config/TestPathResolution/prod_east.yaml_env_and_zone_definedprod_east.yaml_env_and_z…TestNewLogger · introduced test · go.temporal.io/server/common/log/TestLogSuite/TestNewLoggerTestNewLoggerTestReadManifest · introduced test · go.temporal.io/server/tools/common/schema/TestUpdateTaskTestSuite/TestReadManifestTestReadManifestTestReadSchemaDir · introduced test · go.temporal.io/server/tools/common/schema/TestUpdateTaskTestSuite/TestReadSchemaDirTestReadSchemaDirTestReadSchemaDirEFS · introduced test · go.temporal.io/server/tools/common/schema/TestUpdateTaskTestSuite/TestReadSchemaDirEFSTestReadSchemaDirEFSTestReadSchemaDirWithEmptyDir_ReturnsError · introduced test · go.temporal.io/server/tools/common/schema/TestUpdateTaskTestSuite/TestReadSchemaDirWithEmptyDir_ReturnsErrorTestReadSchemaDirWithEmp…TestReadSchemaDirWithEndVersion_ReturnsErrorWhenNotFound · introduced test · go.temporal.io/server/tools/common/schema/TestUpdateTaskTestSuite/TestReadSchemaDirWithEndVersion_ReturnsErrorWhenNotFoundTestReadSchemaDirWithEnd…TestReadSchemaDirWithSameStartAndEnd_ReturnsEmptyList · introduced test · go.temporal.io/server/tools/common/schema/TestUpdateTaskTestSuite/TestReadSchemaDirWithSameStartAndEnd_ReturnsEmptyListTestReadSchemaDirWithSam…TestSortAndFilterVersionsWithEndLessThanStart_ReturnsError · introduced test · go.temporal.io/server/tools/common/schema/TestUpdateTaskTestSuite/TestSortAndFilterVersionsWithEndLessThanStart_ReturnsErrorTestSortAndFilterVersion…TestParseCQLFile · introduced test · go.temporal.io/server/tools/tests/TestCQLClientTestSuite/TestParseCQLFileTestParseCQLFileTestParseCQLFile · introduced test · go.temporal.io/server/tools/tests/TestMySQLConnTestSuite/TestParseCQLFileTestParseCQLFileTestSetupSchema · introduced test · go.temporal.io/server/tools/tests/TestMySQLSetupSchemaTestSuite/TestSetupSchemaTestSetupSchemaTestUpdateSchema · introduced test · go.temporal.io/server/tools/tests/TestMySQLUpdateSchemaTestSuite/TestUpdateSchemaTestUpdateSchemaTestParseCQLFile · introduced test · go.temporal.io/server/tools/tests/TestPostgres/TestPostgreSQLConnTestSuite/TestParseCQLFileTestParseCQLFileTestSetupSchema · introduced test · go.temporal.io/server/tools/tests/TestPostgres/TestPostgreSQLSetupSchemaTestSuite/TestSetupSchemaTestSetupSchemaTestUpdateSchema · introduced test · go.temporal.io/server/tools/tests/TestPostgres/TestPostgreSQLUpdateSchemaTestSuite/TestUpdateSchemaTestUpdateSchemaTestParseCQLFile · introduced test · go.temporal.io/server/tools/tests/TestPostgresPGX/TestPostgreSQLConnTestSuite/TestParseCQLFileTestParseCQLFileTestSetupSchema · introduced test · go.temporal.io/server/tools/tests/TestPostgresPGX/TestPostgreSQLSetupSchemaTestSuite/TestSetupSchemaTestSetupSchemaTestUpdateSchema · introduced test · go.temporal.io/server/tools/tests/TestPostgresPGX/TestPostgreSQLUpdateSchemaTestSuite/TestUpdateSchemaTestUpdateSchemaTestSetupSchema · introduced test · go.temporal.io/server/tools/tests/TestSetupCQLSchemaTestSuite/TestSetupSchemaTestSetupSchemaTestUpdateSchema · introduced test · go.temporal.io/server/tools/tests/TestUpdateCQLSchemaTestSuite/TestUpdateSchemaTestUpdateSchemaFocused file · go.temporal.io/server/tests/testutils/io.go · 34 LOCtestutils/io.go

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 package testutils
2
3 import (
4 "os"
5 "testing"
6
7 "github.com/stretchr/testify/require"
8 )
9
10 // CreateTemp is a helper function which creates a temporary file,
11 // and it is automatically closed after test is completed
12 > func CreateTemp(t testing.TB, dir, pattern string) *os.File { io.go ×1
13 > t.Helper()
14 >
15 > tempFile, err := os.CreateTemp(dir, pattern)
16 > require.NoError(t, err)
17 > require.NotNil(t, tempFile)
18 >
19 > t.Cleanup(func() { require.NoError(t, os.Remove(tempFile.Name())) })
20 > return tempFile
21 }
22
23 // MkdirTemp is a helper function which creates a temporary directory,
24 // and they are automatically removed after test is completed
25 > func MkdirTemp(t testing.TB, dir, pattern string) string { io.go ×1
26 > t.Helper()
27 >
28 > tempDir, err := os.MkdirTemp(dir, pattern)
29 > require.NoError(t, err)
30 > require.NotNil(t, tempDir)
31 >
32 > t.Cleanup(func() { require.NoError(t, os.RemoveAll(tempDir)) })
33 > return tempDir
34 }