summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
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-05-09end-to-end tests: be independent of the user's home directoryKlaus Aehlig
... and, in particular, do not read any rc files for just-mr the user might have.
2023-05-09test: Do not rely on shell built-in behaviorOliver Reiche
... in particular echo(1), which behaves different on dash and sh.
2023-04-28external: Update google_apis to 2f9af29...Paul Cristian Sarbu
...as required by grpc v1.53.0
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-04-21["test/end-to-end", "with remote"]: allow for the usage of a given remote ↵Alberto Sartori
endpoint This can be useful, for example, to test if justbuild can successfully communicate with the specified remote execution service.
2023-04-18test: Use pkgconfig for prebuilt bootstrapOliver Reiche
2023-04-18bootstrap: Replace prebuilt imports by pkgconfigOliver Reiche
2023-04-14just-mr support -D optionKlaus Aehlig
Make just-mr unconditionally support an option -D that collects a configuration overlay and forwards it to the invocation of a just subcommand that supports this option. This syntax-switching facility makes it easy to embedd dynamic parts of the configuration (like the head commit to be part of a version string) as those information can unconditionally be the first argument to just-mr.
2023-04-04Add basic test that roots are available via install-casKlaus Aehlig
2023-03-31fix false positive warning with gcc12Oliver Reiche
2023-03-30Improve error messages on reading invalid target filesKlaus Aehlig
... by including the details of the parse error.
2023-03-30test: Make GitCAS thread-safety tests more strictPaul Cristian Sarbu
Move the creation of a fake repository on top of an existing odb into the individual threads, to ensure the thread-safety of the operations on fake repositories is properly tested.
2023-03-27tests: slience test-data generationKlaus Aehlig
2023-03-27MR Tests: Separate git init and branch creationOliver Reiche
... as `git init -b ...` is a rather recent git feature.
2023-03-27TC Tests: Fix shell variable assignmentOliver Reiche
2023-03-24Extend install test to also verify the --remember optionKlaus Aehlig
2023-03-23Add basic test for install-casKlaus Aehlig
... also verifying that the local CAS is used, even in the presence of remote execution.
2023-03-23execution api: support retrieving from more than one APIKlaus Aehlig
2023-03-23test: Clean up target namesPaul Cristian Sarbu
Using "test" in the name of a test target is unnecessary and adds gratuitous inconsistencies.
2023-03-23just-mr: Add git binary optionPaul Cristian Sarbu
In the rare cases that we need to shell out to git, let the user configure what binary to use. Option resolves in the same way as the just executable, including allowing it to be set via just-mrrc. Updates all cases of shelling out to git (fetch and commit update). Update just-mr and just-mrrc docs accordingly.
2023-03-23just-mr: Shell out to system Git for update commit from SSH remote...Paul Cristian Sarbu
...due to limitations in SSH support in libgit2. In this case, we simply execute 'git ls-remote <repo> [<branch>]' and then parse the output. Remote interogation requires no local repository, so it is an asynchronious operation by default.
2023-03-22just-mr: Shell out to system Git for fetches over SSH...Paul Cristian Sarbu
...due to limited SSH support in libgit2. In order to allow the fetches to still be parallel, we execute: git fetch --no-auto-gc --no-write-fetch-head <repo> [<branch>] This only fetches the packs without updating any refs, at the slight cost of sometimes fetching some redundant information, which for our purposes is practically a non-issue. (If really needed, a 'git gc' call can be done eventually to try to compact the fetched packs, although a save in disk space is not actually guaranteed.)
2023-03-22Add basic test for just-mr defaultsKlaus Aehlig
2023-03-21Move end-to-end tests to a common placeKlaus Aehlig
While for unit tests it is best practice to replicate the layout of the source tree, for end-to-end tests, this is less so. This is particularly true, as the distinction between the tests for two tools is a bit blurry; some tests for just still use just-mr as a launcher, and, e.g., the fetch test for just-mr uses just to carry out the garbage collection. Therefore, move all end-to-end tests together so that we also have a joinded target for precisely the end-to-end tests. In this reorganisation also indicate more explicitly which tests are also available for the bootstrap multi-repo tool. That information was so far hidden by the fact that in the other directory the tool dependency would not dispatch on TEST_BOOTSTRAP_JUST_MR.
2023-03-20just-mr: add test for command verbosityKlaus Aehlig
2023-03-20just-mr fetch: Add test for interaction with garbage collectionKlaus Aehlig
2023-03-15Update gsl-lite to 0.40.0Klaus Aehlig
2023-03-15catch2: bump to version 3.3.2Alberto Sartori
tests have been updated accordingly
2023-03-15bazel client: remove BazelAcClient::UpdateActionResult...Alberto Sartori
...both buildbarn and just execute do not allow a direct upload to the action cache. Moreover, our tool does not support it, anyway, meaning it was dead code.
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-13Test: Add GC test for export targetsOliver Reiche
2023-03-13Test: Extend basic GC test by link count checkOliver Reiche
2023-03-13Test: Extend basic GC test for compatibleOliver Reiche
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-10tests: get rid of credentials repo since tests now use just execute as a ↵Alberto Sartori
remote endpoint
2023-03-10Enforce remote-execution unit testsKlaus Aehlig
... now that they no longer depend on an external remote execution.
2023-03-10Switch CC tests depending on remote executionKlaus Aehlig
... to bring their own remote-execution endpoint.
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-03-08test: Add test for just-mr git tree repository typePaul Cristian Sarbu
2023-03-06Switch shell tests to use just as remote execution endpointKlaus Aehlig
... and, in this way, ensure the test also tests properly in absence of an external remote execution system.
2023-03-06Add rule for shell tests with remote executionKlaus Aehlig
... similar to ["@", "rules", "shell/test", "script"], but implicitly starting a remote execution in the background, passing the information about that endpoint to the test via an environment variable.
2023-03-03test: Add tests for reading in Git proxy settingsPaul Cristian Sarbu
2023-03-03GitRepoRemote: Correctly honor SSL certification settings in fetch and ↵Paul Cristian Sarbu
commit update Uses the SSL certification utility method to correctly set the certification check options for the remote URL libgit2 calls. Due to the fact that remote operations are done via a temporary repository to allow concurrent work, the correct repository configuration needs to be interrogated. Thankfully, libgit2 provides a thread safe config snapshot object to be used in such scenarios. Also updates the existing GitRepoRemote tests accordingly.
2023-03-03test: Add tests for reading in Git SSL certification settingsPaul Cristian Sarbu
2023-03-03test: Add tests for URLs handling utility classPaul Cristian Sarbu
2023-02-28Various typo fixesPaul Cristian Sarbu
Co-authored-by: Sascha Roloff <sascha.roloff@huawei.com>