Commit Graph

40 Commits

Author SHA1 Message Date
Danjela Lura 9e93b2b3a8 Fix the test-model-package-metadata test
Signed-off-by: Christopher Baines <mail@cbaines.net>
2020-06-19 16:03:32 +01:00
Danjela Lura 365bf27838 Fix the test-model-package test
Signed-off-by: Christopher Baines <mail@cbaines.net>
2020-06-19 16:03:32 +01:00
Danjela Lura 480d718fa8 Fix lint checker tests
Signed-off-by: Christopher Baines <mail@cbaines.net>
2020-06-07 20:17:03 +01:00
Christopher Baines 4f7eca2490 Update the valid-systems test 2020-04-20 08:59:10 +01:00
Christopher Baines 1ad581b05a Do some more mocking in the jobs-load-new-guix-revision tests
To help with getting them running on Guile 3.
2020-02-27 21:20:24 +00:00
Christopher Baines 73be24d8ac Remove unused mock-inferior import 2020-02-27 21:13:37 +00:00
Christopher Baines 94321ec274 Don't use the (tests driver) module
As I forget why I even added it. I'm sure it was to try and make test failures
more understandable, but I'm not sure it worked.
2020-02-27 21:10:04 +00:00
Christopher Baines bb7c2a1916 Add a missing import 2020-02-27 21:09:39 +00:00
Christopher Baines 2f41fe79be Adapt some license related code to work without mock in the tests
With Guile 3, there's a potential for mock to work in even fewer
circumstances. So, adapt the code to enable writing the tests without mock.
2020-02-24 21:47:34 +00:00
Christopher Baines ffdde6ba36 Check that the test database is being used in all the tests 2020-02-24 21:16:41 +00:00
Christopher Baines 0c726b9fe7 Clear a couple of tables in the load-new-guix-revision tests
As entries from incomplete previous runs can effect the test, so clean out any
old data before the test begins.
2020-02-24 16:46:10 +00:00
Christopher Baines f6f51bbe0d Fake the store connection in the tests
So that the tests don't require a store connection.
2020-02-14 09:18:28 +00:00
Christopher Baines 0ef3349ed8 Use a more long lived store connection for loading data
As this will enable registering temporary roots, to avoid store items being
garbage collected.
2020-02-13 23:11:36 +00:00
Christopher Baines 9be7dbac0b Start storing channel instance derivations
These are the ones that relate to Guix pull.
2020-02-11 08:56:24 +00:00
Christopher Baines 876bae182d Update the load-new-revision-job tests 2020-02-11 08:55:16 +00:00
Christopher Baines e070c20030 Make valid-systems quicker
In the future, it would be good to pull this from the database again, but in
some way which is really quick.
2020-01-05 12:01:06 +00:00
Christopher Baines f23ee71ea7 Insert channel news entries when loading new guix revisions
If the channel-news-for-commit function is present.
2019-11-21 19:56:19 +00:00
Christopher Baines 66d726f1fd Refactor channel handling in the load-new-guix-revision module
To allow for passing the channel to channel-news-for-commit.
2019-11-21 19:56:19 +00:00
Christopher Baines 1a55022524 Improve the package and package-metadata modules
Add tests around the package module, extract out the use of the
inferior-package record assessors so that they aren't part of the tests, and
switch across the package-metadata module to use
insert-missing-data-and-return-all-ids.
2019-09-05 16:07:23 +02:00
Christopher Baines f29230e034 Put some comments in the mock-inferior module
About mocking the record file accessors not working :(
2019-09-05 16:07:23 +02:00
Christopher Baines d3913a14d5 Start handling ids as numbers, rather than strings
squee, returns all data as strings, and expects strings as inputs to
queries. So, keeping the ids as strings was easy initially, but it means that
you can't tell from the type whether it should be quoted, or not...

Therefore, handle ids as strings, converting them to numbers when they're
fetched from the database, and back to strings as part of the queries.
2019-09-05 16:07:23 +02:00
Christopher Baines 6b9977f62e Store lint warnings in the database
This commit adds the relevant tables and code to store lint warnings in the
database.

Currently, only lint checkers which don't require access to the network will
be run, as this allows the processing to happen without network access. Also,
this functionality won't work in older versions of Guix which don't expose the
lint warnings in a compatible way.
2019-09-01 13:12:10 +01:00
Christopher Baines 9e80bda4f9 Avoid erroring when processing emails again
These changes allow processing emails again, and just creating job and branch
entries where data is missing.
2019-08-05 20:59:48 +01:00
Christopher Baines 712dd377a1 Remove test data after the tests have ran
The load-new-guix-revision tests aren't transactional, so truncate some tables
after running the tests.
2019-08-05 20:45:40 +01:00
Christopher Baines 84197686ce Fix some duplicated values in tables
The licenses table, along with the package_metadata table had duplicate
values. This could happen as the unique constraints on those tables didn't
properly account for the nullable fields.

The duplicates in those tables also affected the license_sets, packages,
package_derivations tables in a similar way. Finally, the
guix_revision_package_derivations table was also affected.

This commit adds a migration to fix the data, as well as the constraints. THe
code to populate the licenses and package_metadata tables is also updated.
2019-08-04 09:39:40 +01:00
Christopher Baines 83ef624b97 Switch to processing jobs in parallel
This should speed up processing new revisions, reduce latency between finding
out about new revisions and processing them, as well as help manage memory
usage, by processing each job in a process that then exits.
2019-07-12 23:00:44 +01:00
Christopher Baines 28baed2667 Fix the name for the jobs-load-new-guix-revision test module 2019-07-12 19:50:36 +01:00
Christopher Baines 743cec7cb6 Associate a name with database connections
This helps when working out which connection to the database is doing what.
2019-07-12 19:49:26 +01:00
Christopher Baines 544dc1558f Add a new test to cover some of the loading new revisions code 2019-06-02 22:02:12 +01:00
Christopher Baines 26cdf5568f Fix the package-metadata tests 2019-05-16 00:25:45 +01:00
Christopher Baines e6effe7556 Fix how email dates are inserted in to PostgreSQL
Previously, the timezone was stripped off, so the timestamps were off. This
commit changes the code to use a Unix timestamp, which avoids this issue.
2019-05-16 00:03:06 +01:00
Christopher Baines 16799a34a9 Store license information for packages
And display this on the package page.

This uses a couple of new tables, and an additional field in the
package_metadata table.

Currently, the order of the licenses in the package definition isn't stored,
as I'm not sure the order in the list is significant.
2019-05-15 08:05:14 +01:00
Christopher Baines 28c2d46081 Fix type issues with the location ids
On one code path, they were handled as numbers, whereas elsewhere they were
handled as strings. This led to the package-metadata code trying to insert
duplicate entries.

Instead, just handle them as strings everywhere.
2019-05-14 07:55:17 +01:00
Christopher Baines 7341d17254 Store and display the location of packages
Store the location a package can be found at, and display this on the package
page.

If available, link off to the git repository containing the package.
2019-05-13 21:07:48 +01:00
Christopher Baines 8eac26b17d Remove the sha1_hash from the package_metadata table
I'm thinking about adding more fields to this table, and the sha1_hash values
will make this tricker.

Therefore, remove the value, and adjust the existing code to cope. This commit
also adds a new test which coveres some of the changed functionality.
2019-05-12 18:08:17 +01:00
Christopher Baines 0ab1c71722 Add a mock-inferior module
This to help test code which uses the (guix inferior) module.
2019-05-12 17:32:37 +01:00
Christopher Baines d212682061 Add a (tests driver) module
Using the test driver from build-aux/test-driver.scm, as this shows the test
errors when tests fail.
2019-05-12 17:32:21 +01:00
Christopher Baines 5028dfe706 Start to handle information about Git branches
Add some new pages /branches and /branch/... as well as a new git_branches
table. Also extend the email processing to enter the branch information in to
the database.
2019-05-05 20:06:28 +01:00
Christopher Baines ce4c3c6ed3 Switch to storing Git repositories in a table
Rather than just storing the URL in the guix_revisions and
load_new_guix_revision_jobs tables. This will help when storing more
information like tags and branches in the future.
2019-05-05 14:36:52 +01:00
Christopher Baines ef4fd5ab4f Add an initial test
Along with the buildsystem changes to make `make check` work.
2019-04-14 10:08:11 +01:00