summaryrefslogtreecommitdiff
path: root/test/utils
AgeCommit message (Collapse)Author
2024-03-07Add test verifying that just-mr only uses the network if necessaryKlaus Aehlig
2024-02-07graph_traverser test: provide env trough launcherKlaus T. Aehlig
... instead of hard-coding it in the example graphs. In this way, we can honor a provided PATH.
2023-12-21BazelCasClient::DoUploadBlobs: returns the count of the uploaded blobs...Alberto Sartori
...instead of the vector containing the digests of the uploaded blobs. The returned vector was never inspected by the callers, except for its size. The tests have been accordingly amended.
2023-11-02ArchiveOps: Move libarchive utilities outside other_toolsPaul Cristian Sarbu
This way they can be used by 'just serve'.
2023-09-15just serve: add remote execution endpoint and --fetch-absent optionPaul Cristian Sarbu
The serve service will communicate with this endpoint when needed, as well as ensure artifacts it provides are synced with the remote execution CAS, if requested by the client. If just-mr is given the --fetch-absent option, it Always produce present roots irrespective of the 'absent' pragma. For Git repositories marked with the 'absent' pragma, first try to fetch any commit trees provided by the serve endpoint from the execution endpoint CAS, before reverting to a network fetch. Co-authored-by: Klaus Aehlig <klaus.aehlig@huawei.com> Co-authored-by: Alberto Sartori <alberto.sartori@huawei.com>
2023-09-13test: Add test environment running 'just serve'Paul Cristian Sarbu
2023-08-29python: Add type hints and fix style in test scriptsPaul Cristian Sarbu
For maximum compatibility, we use the uppercase types from the typing package instead of the built-in types, therefore compliant with PEP 484 and PEP 526.
2023-08-07utils: Add function to check for confined pathsPaul Cristian Sarbu
2023-07-25test_server: avoid racesKlaus Aehlig
... by creating a file only once the server is ready and waiting for that file instead of waiting a fixed period of time.
2023-06-26filesystem: Add logic for handling (non-upwards) symlinksPaul Cristian Sarbu
2023-05-30tests: Support toolchain in remote ruleOliver Reiche
2023-05-30tests: Used installed just/just-mr in remote testsOliver Reiche
... as those binaries might need run-libs.
2023-05-30tests: Use run_test expression in remote ruleOliver Reiche
2023-05-24Split off tests into a separate logical repositoryKlaus Aehlig
This allows better separation and, in particular, repositories needed only for tests do not have to be provided for building the tools. This also better documents which dependencies are only needed for testing.
2023-05-15memcheck: fix race in libgit2...Paul Cristian Sarbu
...caused by incorrectly setting and resetting the library internal state and the misuse of pthreads in libgit2. Normally, git_libgit2_init and git_libgit2_shutdown should span the life of a worker thread in order to be safely used. However, due to an incorrect implementation of libgit2's threadstate with pthreads, on unix systems there is a race condition. Until the use of pthread_key_t is corrected in libgit2, we need to apply a workaround by always ensuring that the main thread is the first thread reaching the GitContext constructor.
2023-04-26imports: Switch to Microsoft GSL implementationOliver Reiche
... with two minor code base changes compared to previous use of gsl-lite: - dag.hpp: ActionNode::Ptr and ArtifactNode::Ptr are not wrapped in gsl::not_null<> anymore, due to lack of support for wrapping std::unique_ptr<>. More specifically, the move constructor is missing, rendering it impossible to use std::vector<>::emplace_back(). - utils/cpp/gsl.hpp: New header file added to implement the macros ExpectsAudit() and EnsureAudit(), asserts running only in debug builds, which were available in gsl-lite but are missing in MS GSL.
2023-03-15catch2: bump to version 3.3.2Alberto Sartori
tests have been updated accordingly
2023-03-15add missing ldflags -pthread and use -pthread consistentlyAlberto Sartori
2023-03-13Storage: Reworked storage and garbage collectionOliver Reiche
The improved GC implementation uses refactored storage classes instead of directly accessing "unknown" file paths. The required storage class refactoring is quite substantial and outlined in the following paragraphs. The module `buildtool/file_system` was extended by: - `ObjectCAS`: a plain CAS implementation for reading/writing blobs and computing digests for a given `ObjectType`. Depending on that type, files written to the file system may have different properties (e.g., the x-bit set) or the digest may be computed differently (e.g., tree digests in non-compatible mode). A new module `buildtool/storage` was introduced containing: - `LocalCAS`: provides a common interface for the "logical CAS", which internally combines three `ObjectCAS`s, one for each `ObjectType` (file, executable, tree). - `LocalAC`: implements the action cache, which needs the `LocalCAS` for storing cache values. - `TargetCache`: implements the high-level target cache, which also needs the `LocalCAS` for storing cache values. - `LocalStorage`: combines the storage classes `LocalCAS`, `LocalAC`, and `TargetCache`. Those are initialized with settings from `StorageConfig`, such as the build root base path or number of generations for the garbage collector. `LocalStorage` is templated with a Boolean parameter `kDoGlobalUplink`, which indicates that, on every read/write access, the garbage collector should be used for uplinking across all generations (global). - `GarbageCollector`: responsible for garbage collection and the global uplinking across all generations. To do so, it employs instances of `LocalStorage` with `kDoGlobalUplink` set to false, in order to avoid endless recursion. The actual (local) uplinking within two single generations is performed by the corresponding storage class (e.g., `TargetCache` implements uplinking of target cache entries between two target cache generations etc.). Thereby, the actual knowledge how data should be uplinked is implemented by the instance that is responsible for creating the data in the first place.
2023-03-13Remote Tests: Dump server output to fileOliver Reiche
... instead of using pipes that are prone to get full. Also increase log level to Trace.
2023-03-13Remote Tests: Ensure writable build root existsOliver Reiche
2023-03-10Enforce remote-execution unit testsKlaus Aehlig
... now that they no longer depend on an external remote execution.
2023-03-10Add a rule for CC tests depending on remote executionKlaus Aehlig
In order to keep our tests self-contained, do not rely on an external remote-execution service to be present; instead, use `just execute` to provide the remote execution service.
2023-03-09bugfix: bazel api tests: upload empty root for actions as Tree and not as FileAlberto Sartori
2023-02-22test: Remove unnecessary line of code in run_test_server.pyPaul Cristian Sarbu
2023-02-22ExecutionApi: Retrieve to correct CAS directlyOliver Reiche
... by keeping track of each blob being a file or executable and storing it to the correct local physical CAS directory. The new flag is merely a hint and only used by the local execution API. Leaving it out will still correctly transfer the blob but may cause unnecessary duplicates in file CAS.
2023-02-17structure cleanup: move libcurl utilities to other_tools...Paul Cristian Sarbu
...in order to not include unwanted dependencies in just proper. As the whole other_tools folder is meant to be excluded from bootstrapping, also remove the bootstrap guards.
2023-02-17structure cleanup: move libarchive utilities to other_tools...Paul Cristian Sarbu
...in order to not include unwanted dependencies in just proper. As the whole other_tools folder is meant to be excluded from bootstrapping, also remove the bootstrap guards.
2023-02-17tests: Add proper quoting when system calling the shellPaul Cristian Sarbu
2023-02-14targets: fix missing staging of individual testsPaul Cristian Sarbu
2023-01-20Add local garbage collectionSascha Roloff
2023-01-20Test: Add tests for file locking utility classPaul Cristian Sarbu
2023-01-20tests: pass tls certificates and keyAlberto Sartori
2022-12-21Test: Upd libarchive tests with wrapper classPaul Cristian Sarbu
2022-12-21Test: Add basic tests for libarchiveOliver Reiche
2022-12-21Test: Add tests for libcurlPaul Cristian Sarbu
2022-12-09rules: Refactoring and minor improvementsOliver Reiche
Compared to the previous commit, the action graphs for just and its unit tests are unchanged. - Git hash of action graph for ["",""]: c6e75f17abd7ffaab6ff9bb725ad67ec0bf6c973 - Git hash of action graph for ["test/buildtool","TESTS"]: 8063dfb3dd7daa9ae01d95c177e14946f785c57e Refactor: - "local cflags" to "private-cflags" - "local defines" to "private-defines" - "link externals" to "private-ldflags" - "deps" to "private-deps" for (test) binaries - "proto" to "private-proto" for binaries Improvements: - consistent variable declaration order: OS, ARCH, HOST_ARCH, TARGET_ARCH, CC, CXX, CFLAGS, CXXFLAGS, ADD_CFLAGS, ADD_CXXFLAGS, AR, ENV, PATH - use fields close to their definition (in RULES) - use common expression for binaries and test binaries - split expression "flags" and "compiler" ... to separate ones for CC and CXX. - rename "transition" to "deps-transition" ... to avoid conflicts with other transitions. - support "defaults-transition" for CC expressions Implement: - "cflags" for libraries - "private-cflags" for (test) binaries - "private-defines" for test binaries - "private-ldflags" for test binaries - (public) "defines" for libraries
2022-10-14Remove default value of ArtifactDigest::Create template parameterSascha Roloff
This enforces the explicit specification, which object type, either file or tree, should be used to create an artifact digest. This also avoids subtile errors at locations as in the previous commit, where files as well as trees are supposed to be handled, but digest creation mistakenly defaults to file object type.
2022-10-12Add copyright and license notice to all source and header filesKlaus Aehlig
Signed-off-by: Goetz Brasche <goetz.brasche@huawei.com>
2022-06-20Crypto: Add and use set of globally used hash functionsOliver Reiche
2022-06-13Logging: Extend logger by level for PerformanceOliver Reiche
2022-06-13RemoteExecutionConfig: Keep global platform propertiesOliver Reiche
... and cache endpoint address for rebuilding.
2022-05-12Ensure consistent path normalisationKlaus Aehlig
In particular, ensure that the empty path and "." have the same normal form.
2022-05-11Remove dead codeKlaus Aehlig
2022-05-09allow for run tests in compatibility modeAlberto Sartori
2022-04-04Add a new log level for progress updatesKlaus Aehlig
2022-03-23Apply changes suggested by clang-tidy 11Oliver Reiche
2022-03-16Format: Apply compact JSON formattingOliver Reiche
2022-02-22Initial self-hosting commitKlaus Aehlig
This is the initial version of our tool that is able to build itself. In can be bootstrapped by ./bin/bootstrap.py Co-authored-by: Oliver Reiche <oliver.reiche@huawei.com> Co-authored-by: Victor Moreno <victor.moreno1@huawei.com>