• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

HicServices / RDMP / 11457925069

pending completion
11457925069

push

github

JFriel
Merge branch 'develop' of https://github.com/HicServices/RDMP

11207 of 21044 branches covered (53.26%)

Branch coverage included in aggregate %.

25 of 51 new or added lines in 3 files covered. (49.02%)

705 existing lines in 27 files now uncovered.

31728 of 53779 relevant lines covered (59.0%)

4115.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.1
/Rdmp.Core/DataLoad/Engine/Checks/CheckEntireDataLoadProcess.cs
1
// Copyright (c) The University of Dundee 2018-2019
2
// This file is part of the Research Data Management Platform (RDMP).
3
// RDMP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4
// RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
5
// You should have received a copy of the GNU General Public License along with RDMP. If not, see <https://www.gnu.org/licenses/>.
6

7
using System;
8
using Rdmp.Core.Caching.Layouts;
9
using Rdmp.Core.CommandExecution;
10
using Rdmp.Core.Curation.Data.DataLoad;
11
using Rdmp.Core.DataLoad.Engine.Checks.Checkers;
12
using Rdmp.Core.DataLoad.Engine.DatabaseManagement.EntityNaming;
13
using Rdmp.Core.DataLoad.Engine.LoadProcess;
14
using Rdmp.Core.ReusableLibraryCode.Checks;
15

16
namespace Rdmp.Core.DataLoad.Engine.Checks;
17

18
/// <summary>
19
/// Checks a LoadMetadata it is in a fit state to be executed (does it have primary keys, backup trigger etc).
20
/// </summary>
21
public class CheckEntireDataLoadProcess : ICheckable
22
{
23
    private readonly HICDatabaseConfiguration _databaseConfiguration;
24
    private readonly HICLoadConfigurationFlags _loadConfigurationFlags;
25
    private readonly IBasicActivateItems _activator;
26

27
    public ILoadMetadata LoadMetadata { get; set; }
434✔
28

29
    public CheckEntireDataLoadProcess(IBasicActivateItems activator, ILoadMetadata loadMetadata, HICDatabaseConfiguration databaseConfiguration,
72✔
30
        HICLoadConfigurationFlags loadConfigurationFlags)
72✔
31
    {
32
        _activator = activator;
72✔
33
        _databaseConfiguration = databaseConfiguration;
72✔
34
        _loadConfigurationFlags = loadConfigurationFlags;
72✔
35
        LoadMetadata = loadMetadata;
72✔
36
    }
72✔
37

38
    public void Check(ICheckNotifier notifier)
39
    {
40
        var catalogueLoadChecks =
72✔
41
            new CatalogueLoadChecks(LoadMetadata, _loadConfigurationFlags, _databaseConfiguration);
72✔
42
        var metadataLoggingConfigurationChecks = new MetadataLoggingConfigurationChecks(LoadMetadata);
72✔
43
        var processTaskChecks = new ProcessTaskChecks(LoadMetadata,_activator);
72✔
44
        var preExecutionChecks = new PreExecutionChecker(LoadMetadata, _databaseConfiguration);
72✔
45

46
        //If the load is a progressable (loaded over time) then make sure any associated caches are compatible with the load ProcessTasks
47
        foreach (var loadProgress in LoadMetadata.LoadProgresses)
148✔
48
        {
49
            loadProgress.Check(notifier);
2✔
50

51
            var cp = loadProgress.CacheProgress;
2✔
52
            if (cp != null)
2✔
53
                try
54
                {
55
                    var f = new CacheLayoutFactory();
2✔
56
                    CacheLayoutFactory.CreateCacheLayout(loadProgress, LoadMetadata);
2✔
57
                }
2✔
58
                catch (Exception e)
×
59
                {
UNCOV
60
                    notifier.OnCheckPerformed(new CheckEventArgs(
×
UNCOV
61
                        $"Load contains a CacheProgress '{cp}' but we were unable to generate an ICacheLayout, see Inner Exception for details",
×
UNCOV
62
                        CheckResult.Fail, e));
×
UNCOV
63
                }
×
64
        }
65

66
        //Make sure there are some load tasks and they are valid
67
        processTaskChecks.Check(notifier);
72✔
68

69

70
        try
71
        {
72
            metadataLoggingConfigurationChecks.Check(notifier);
70✔
73

74
            preExecutionChecks.Check(notifier);
70✔
75

76
            if (!preExecutionChecks.HardFail)
66✔
77
                catalogueLoadChecks.Check(notifier);
66✔
78
        }
60✔
79
        catch (Exception e)
10✔
80
        {
81
            notifier.OnCheckPerformed(new CheckEventArgs("Entire check process crashed in an unexpected way",
10✔
82
                CheckResult.Fail, e));
10✔
83
        }
2✔
84
    }
62✔
85
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc