depot/nix/runTestsuite, branch refs/r/7267 monorepo for the virus lounge http://code.tvl.fyi/depot/atom?h=refs%2Fr%2F7267 2022-01-31T16:11:53+00:00 style: format entire depot with nixpkgs-fmt 2022-01-31T16:11:53+00:00 Vincent Ambo mail@tazj.in 2022-01-30T16:06:58+00:00 urn:sha1:aa122cbae78ce97d60c0c98ba14df753d97e40b1 This CL can be used to compare the style of nixpkgs-fmt against other formatters (nixpkgs, alejandra). Change-Id: I87c6abff6bcb546b02ead15ad0405f81e01b6d9e Reviewed-on: https://cl.tvl.fyi/c/depot/+/4397 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: lukegb <lukegb@tvl.fyi> Reviewed-by: wpcarro <wpcarro@gmail.com> Reviewed-by: Profpatsch <mail@profpatsch.de> Reviewed-by: kanepyork <rikingcoding@gmail.com> Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: cynthia <cynthia@tvl.fyi> Reviewed-by: edef <edef@edef.eu> Reviewed-by: eta <tvl@eta.st> Reviewed-by: grfn <grfn@gws.fyi> fix(nix/runTestsuite): don't crash on big test suites 2021-11-25T11:15:35+00:00 sterni sternenseemann@systemli.org 2021-11-23T19:23:13+00:00 urn:sha1:8dc54f89cdaf2e029230adbd14242ba0db6832ab Having `prettyRes` in the execline script causes it to fail because of the argv limit if your test suite is long enough. For the succeeding one we can work around this by hashing it (since we only care that something changes if the test suite changes), in the case of the failing one where we want to print the results, we use runExecline's stdin mechanism. Change-Id: I2489f76acfbe809351f51caefe2a477328a70ee3 refactor(nix/runTestsuite): clean up runTestsuite 2021-09-17T11:47:41+00:00 sterni sternenseemann@systemli.org 2021-09-14T22:17:27+00:00 urn:sha1:5dec98233482ebd651f9be77984a178d6656efe4 * goodAss wasn't used before. Simplify it to just return a boolean, so we can use it for partitionTests later. * goodIt also returns unnecessary extra meta information which is not used. Cleaning that up makes the condition extremely small, so we can inline it into (what was) goodIts. * goodIts is just called in one place, so we can inline it into res. Change-Id: I70cf4fa3f61ce1467a2ee5319f841cdd42db6a66 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3548 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de> feat(nix/runTestsuite): rebuild if test case list changes 2021-09-14T14:10:46+00:00 sterni sternenseemann@systemli.org 2021-09-11T17:25:39+00:00 urn:sha1:987b9b551c42642c7be9363737faa0629fe87117 If the result of the assertions changes for a successful test suite (this happens if tests are reworded, added or removed), this makes sure the no-op derivation is rebuilt. This makes sure that test suites show up in buildkite on ocassions other than channel bumps, since they are only added to the job list if their `outPath` is missing nowadays (see cl/3427). Change-Id: Ia1050cca5eeed8b7da84c40f6154b40760a3047f Reviewed-on: https://cl.tvl.fyi/c/depot/+/3536 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de> fix(nix/runTestsuite): use s6-portable-utils 2021-03-26T11:01:20+00:00 Profpatsch mail@profpatsch.de 2021-03-26T10:40:26+00:00 urn:sha1:d0b635f6f2cd8a329980d1574f448041064f7d1a Same as 221698c603dcb318c609b4d21cb2a9fada44a14c We had a bunch of instances of https://github.com/NixOS/nix/issues/2176, where nix would exit with a “killed by signal 9” error. According to Eelco in that issue, this is perfectly normal behaviour of course, and appears if the last command in a loop closes `stdout` or `stdin`, then the builder will SIGKILL it immediately. This is of course also a perfectly fine error message for that case. It turns out that mainly GNU coreutils exhibit this behaviour … Let’s see if using a more sane tool suite fixes that. Change-Id: Iaf9e542952ca36c02208a3f067f575ba978272b4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2663 Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI feat(nix/runTestsuite): add assertDoesNotThrow 2021-02-09T21:57:56+00:00 sterni sternenseemann@systemli.org 2021-01-31T18:22:35+00:00 urn:sha1:fde23c5d0af0c09bccbfa6c3402bfaeae9bf88e0 assertDoesNotThrow is like assertThrows, but fails if the expression throws. In that case the new unexpected-throw branch of AssertErrorContext is returned. Change-Id: I7195eb5df8965456e9ab9b69e35ec96b33f00a35 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2476 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de> refactor(nix/runTestsuite): implement in terms of generic assertBool 2021-02-09T21:57:56+00:00 sterni sternenseemann@systemli.org 2021-01-31T12:41:32+00:00 urn:sha1:00f79da3581d5902ad1b45795cdf9334d6becad3 Refactor assertEq and assertThrows to be implemented in terms of a more generic assertBool to reduce code duplication and ease adding new assert types. To preserve meaningful error messages AssertResult is changed slightly: nope-eq and nope-throw have been replaced by a single nope branch which contains an AssertErrorContext which contains error information. To implement an assert assertBoolContext (which is not exposed) can be used: It takes an AssertErrorContext which is returned in case of an error and a boolean determining whether the assert was successful. The currently possible AssertErrorContext are: * should-throw: error result of assertThrows, formerly nope-throw * not-equal: error result of assertEq, formerly nope-eq Change-Id: Ifd6b3aa4187c90c3add2df63fa7c906c8f03fd2d Reviewed-on: https://cl.tvl.fyi/c/depot/+/2473 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de> feat(nix/runTestsuite): add assertThrows 2021-01-30T11:44:25+00:00 Profpatsch mail@profpatsch.de 2021-01-29T19:53:26+00:00 urn:sha1:f4a4da134b42e3fcb95101e98aaba6d23c35e193 Uses `builtins.tryEval` to check that the expression throws when `deepSeq`-ed. Change-Id: I0d57cc37f473bb733f57a1b1c0d889084152fd2f Reviewed-on: https://cl.tvl.fyi/c/depot/+/2463 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> fix(nix/runTestsuite): wrap runTestsuite into derivation 2021-01-30T11:44:25+00:00 Profpatsch mail@profpatsch.de 2021-01-29T19:48:00+00:00 urn:sha1:7f091079ce834775abcd4840ca42122727f4593e Previously we would throw or return `{}`, which doesn’t integrate nicely into our CI; thus, let’s wrap it into a derivation which either fails the build or doesn’t. Change-Id: I65880d86b8393094661e57a0b32aafe748bf1dd5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2462 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI feat(nix/runTestsuite): add runTestsuite 2020-06-28T03:52:40+00:00 Profpatsch mail@profpatsch.de 2020-06-27T20:56:58+00:00 urn:sha1:c8e888c1d2c6dfe60a835d1810ab57d87d097e93 This is a very simple test suite for nix expressions. It should help us set up a good suite of unit tests for our nix-based stuff. Since we allow import from derivation, these tests can also depend on derivations and e.g. use `builtins.readFile` to check outputs. This is a first PoC to get us going, we can always replace it by something different in the future if we don’t like it. Change-Id: I206c7b624db2b1dabd9c73ffce4f87e658919958 Reviewed-on: https://cl.tvl.fyi/c/depot/+/662 Reviewed-by: tazjin <mail@tazj.in> Tested-by: tazjin <mail@tazj.in>
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<feed xmlns="http://www.w3.org/2005/Atom">
<title>depot/nix/runTestsuite, branch refs/r/7267</title>
<subtitle>monorepo for the virus lounge</subtitle>
<id>http://code.tvl.fyi/depot/atom?h=refs%2Fr%2F7267</id>
<link rel="self" href="http://code.tvl.fyi/depot/atom?h=refs%2Fr%2F7267"/>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/"/>
<updated>2022-01-31T16:11:53+00:00</updated>
<entry>
<title>style: format entire depot with nixpkgs-fmt</title>
<updated>2022-01-31T16:11:53+00:00</updated>
<author>
<name>Vincent Ambo</name>
<email>mail@tazj.in</email>
</author>
<published>2022-01-30T16:06:58+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=aa122cbae78ce97d60c0c98ba14df753d97e40b1"/>
<id>urn:sha1:aa122cbae78ce97d60c0c98ba14df753d97e40b1</id>
<content type="text"> This CL can be used to compare the style of nixpkgs-fmt against other formatters (nixpkgs, alejandra). Change-Id: I87c6abff6bcb546b02ead15ad0405f81e01b6d9e Reviewed-on: https://cl.tvl.fyi/c/depot/+/4397 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: lukegb <lukegb@tvl.fyi> Reviewed-by: wpcarro <wpcarro@gmail.com> Reviewed-by: Profpatsch <mail@profpatsch.de> Reviewed-by: kanepyork <rikingcoding@gmail.com> Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: cynthia <cynthia@tvl.fyi> Reviewed-by: edef <edef@edef.eu> Reviewed-by: eta <tvl@eta.st> Reviewed-by: grfn <grfn@gws.fyi> </content>
</entry>
<entry>
<title>fix(nix/runTestsuite): don't crash on big test suites</title>
<updated>2021-11-25T11:15:35+00:00</updated>
<author>
<name>sterni</name>
<email>sternenseemann@systemli.org</email>
</author>
<published>2021-11-23T19:23:13+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=8dc54f89cdaf2e029230adbd14242ba0db6832ab"/>
<id>urn:sha1:8dc54f89cdaf2e029230adbd14242ba0db6832ab</id>
<content type="text"> Having `prettyRes` in the execline script causes it to fail because of the argv limit if your test suite is long enough. For the succeeding one we can work around this by hashing it (since we only care that something changes if the test suite changes), in the case of the failing one where we want to print the results, we use runExecline's stdin mechanism. Change-Id: I2489f76acfbe809351f51caefe2a477328a70ee3 </content>
</entry>
<entry>
<title>refactor(nix/runTestsuite): clean up runTestsuite</title>
<updated>2021-09-17T11:47:41+00:00</updated>
<author>
<name>sterni</name>
<email>sternenseemann@systemli.org</email>
</author>
<published>2021-09-14T22:17:27+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=5dec98233482ebd651f9be77984a178d6656efe4"/>
<id>urn:sha1:5dec98233482ebd651f9be77984a178d6656efe4</id>
<content type="text"> * goodAss wasn't used before. Simplify it to just return a boolean, so we can use it for partitionTests later. * goodIt also returns unnecessary extra meta information which is not used. Cleaning that up makes the condition extremely small, so we can inline it into (what was) goodIts. * goodIts is just called in one place, so we can inline it into res. Change-Id: I70cf4fa3f61ce1467a2ee5319f841cdd42db6a66 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3548 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de> </content>
</entry>
<entry>
<title>feat(nix/runTestsuite): rebuild if test case list changes</title>
<updated>2021-09-14T14:10:46+00:00</updated>
<author>
<name>sterni</name>
<email>sternenseemann@systemli.org</email>
</author>
<published>2021-09-11T17:25:39+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=987b9b551c42642c7be9363737faa0629fe87117"/>
<id>urn:sha1:987b9b551c42642c7be9363737faa0629fe87117</id>
<content type="text"> If the result of the assertions changes for a successful test suite (this happens if tests are reworded, added or removed), this makes sure the no-op derivation is rebuilt. This makes sure that test suites show up in buildkite on ocassions other than channel bumps, since they are only added to the job list if their `outPath` is missing nowadays (see cl/3427). Change-Id: Ia1050cca5eeed8b7da84c40f6154b40760a3047f Reviewed-on: https://cl.tvl.fyi/c/depot/+/3536 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de> </content>
</entry>
<entry>
<title>fix(nix/runTestsuite): use s6-portable-utils</title>
<updated>2021-03-26T11:01:20+00:00</updated>
<author>
<name>Profpatsch</name>
<email>mail@profpatsch.de</email>
</author>
<published>2021-03-26T10:40:26+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=d0b635f6f2cd8a329980d1574f448041064f7d1a"/>
<id>urn:sha1:d0b635f6f2cd8a329980d1574f448041064f7d1a</id>
<content type="text"> Same as 221698c603dcb318c609b4d21cb2a9fada44a14c We had a bunch of instances of https://github.com/NixOS/nix/issues/2176, where nix would exit with a “killed by signal 9” error. According to Eelco in that issue, this is perfectly normal behaviour of course, and appears if the last command in a loop closes `stdout` or `stdin`, then the builder will SIGKILL it immediately. This is of course also a perfectly fine error message for that case. It turns out that mainly GNU coreutils exhibit this behaviour … Let’s see if using a more sane tool suite fixes that. Change-Id: Iaf9e542952ca36c02208a3f067f575ba978272b4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2663 Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI </content>
</entry>
<entry>
<title>feat(nix/runTestsuite): add assertDoesNotThrow</title>
<updated>2021-02-09T21:57:56+00:00</updated>
<author>
<name>sterni</name>
<email>sternenseemann@systemli.org</email>
</author>
<published>2021-01-31T18:22:35+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=fde23c5d0af0c09bccbfa6c3402bfaeae9bf88e0"/>
<id>urn:sha1:fde23c5d0af0c09bccbfa6c3402bfaeae9bf88e0</id>
<content type="text"> assertDoesNotThrow is like assertThrows, but fails if the expression throws. In that case the new unexpected-throw branch of AssertErrorContext is returned. Change-Id: I7195eb5df8965456e9ab9b69e35ec96b33f00a35 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2476 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de> </content>
</entry>
<entry>
<title>refactor(nix/runTestsuite): implement in terms of generic assertBool</title>
<updated>2021-02-09T21:57:56+00:00</updated>
<author>
<name>sterni</name>
<email>sternenseemann@systemli.org</email>
</author>
<published>2021-01-31T12:41:32+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=00f79da3581d5902ad1b45795cdf9334d6becad3"/>
<id>urn:sha1:00f79da3581d5902ad1b45795cdf9334d6becad3</id>
<content type="text"> Refactor assertEq and assertThrows to be implemented in terms of a more generic assertBool to reduce code duplication and ease adding new assert types. To preserve meaningful error messages AssertResult is changed slightly: nope-eq and nope-throw have been replaced by a single nope branch which contains an AssertErrorContext which contains error information. To implement an assert assertBoolContext (which is not exposed) can be used: It takes an AssertErrorContext which is returned in case of an error and a boolean determining whether the assert was successful. The currently possible AssertErrorContext are: * should-throw: error result of assertThrows, formerly nope-throw * not-equal: error result of assertEq, formerly nope-eq Change-Id: Ifd6b3aa4187c90c3add2df63fa7c906c8f03fd2d Reviewed-on: https://cl.tvl.fyi/c/depot/+/2473 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de> </content>
</entry>
<entry>
<title>feat(nix/runTestsuite): add assertThrows</title>
<updated>2021-01-30T11:44:25+00:00</updated>
<author>
<name>Profpatsch</name>
<email>mail@profpatsch.de</email>
</author>
<published>2021-01-29T19:53:26+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=f4a4da134b42e3fcb95101e98aaba6d23c35e193"/>
<id>urn:sha1:f4a4da134b42e3fcb95101e98aaba6d23c35e193</id>
<content type="text"> Uses `builtins.tryEval` to check that the expression throws when `deepSeq`-ed. Change-Id: I0d57cc37f473bb733f57a1b1c0d889084152fd2f Reviewed-on: https://cl.tvl.fyi/c/depot/+/2463 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> </content>
</entry>
<entry>
<title>fix(nix/runTestsuite): wrap runTestsuite into derivation</title>
<updated>2021-01-30T11:44:25+00:00</updated>
<author>
<name>Profpatsch</name>
<email>mail@profpatsch.de</email>
</author>
<published>2021-01-29T19:48:00+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=7f091079ce834775abcd4840ca42122727f4593e"/>
<id>urn:sha1:7f091079ce834775abcd4840ca42122727f4593e</id>
<content type="text"> Previously we would throw or return `{}`, which doesn’t integrate nicely into our CI; thus, let’s wrap it into a derivation which either fails the build or doesn’t. Change-Id: I65880d86b8393094661e57a0b32aafe748bf1dd5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2462 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI </content>
</entry>
<entry>
<title>feat(nix/runTestsuite): add runTestsuite</title>
<updated>2020-06-28T03:52:40+00:00</updated>
<author>
<name>Profpatsch</name>
<email>mail@profpatsch.de</email>
</author>
<published>2020-06-27T20:56:58+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=c8e888c1d2c6dfe60a835d1810ab57d87d097e93"/>
<id>urn:sha1:c8e888c1d2c6dfe60a835d1810ab57d87d097e93</id>
<content type="text"> This is a very simple test suite for nix expressions. It should help us set up a good suite of unit tests for our nix-based stuff. Since we allow import from derivation, these tests can also depend on derivations and e.g. use `builtins.readFile` to check outputs. This is a first PoC to get us going, we can always replace it by something different in the future if we don’t like it. Change-Id: I206c7b624db2b1dabd9c73ffce4f87e658919958 Reviewed-on: https://cl.tvl.fyi/c/depot/+/662 Reviewed-by: tazjin <mail@tazj.in> Tested-by: tazjin <mail@tazj.in> </content>
</entry>
</feed>