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

HicServices / RDMP / 9758065908

02 Jul 2024 09:03AM UTC coverage: 56.679% (-0.2%) from 56.914%
9758065908

push

github

web-flow
Release/8.2.0 (#1867)

* add extraction additions

* interim

* add test

* interim

* working dedupe

* improved checking

* add timestamp option

* fix extra looping

* add check

* start on tests

* tidy up code

* update link

* tidy up

* Rename executeFullExtractionToDatabaseMSSql.md to ExecuteFullExtractionToDatabaseMSSql.md

* fix typo

* add docs

* update

* update documentation

* attempt fix docs

* update docs

* tidy up code

* better tests

* add real test

* tidy up

* interim

* grab existiing entity

* no new data

* add basic tests

* attempt to fix test

* interim

* interim commit

* working clash

* add test

* fix test

* improved clash checker

* tidy up

* update test

* fix up test

* update from codeql

* tidy up code

* fix bad merge

* fix typo

* skip over for now

* revert change

* Task/RDMP-180 Add instance settings table (#1820)

* working settings interface

* add documentation

* add missing files

* update namespace

* add icon

* update from run

* make key unique

* add tests

* update tests

* update for tests

* fix unique name issue

* tidy up

* tidy up from review

* works

* nested deprications

* recursive deprication

* tidy up

* add newline

* Task/rdmp 174 dqe improvements (#1849)

* working scallable graph

* add changelog

* add axis override

* interim

* working increments

* working ui refresh

* update changelog

* tidy up code

* add missing file

* tidy up

* Task/rdmp 155 migrate catalogue tables (#1805)

* start of UI

* interim

* working switch

* improved ui

* fix build

* rename duped file

* imterim

* add checks

* start of tests

* local tests  working

* add tests

* improved ui

* tidy up

* add single item use

* broken test

* updated tests

* tidy up imports

* add some documentation

* fix docume... (continued)

10912 of 20750 branches covered (52.59%)

Branch coverage included in aggregate %.

369 of 831 new or added lines in 38 files covered. (44.4%)

375 existing lines in 25 files now uncovered.

30965 of 53135 relevant lines covered (58.28%)

7845.71 hits per line

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

66.67
/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandCreateNewSplitDataLoadDirectory.cs
1
// Copyright (c) The University of Dundee 2024-2024
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.IO;
8
using Rdmp.Core.Curation;
9
using Rdmp.Core.Curation.Data;
10
using Rdmp.Core.Curation.Data.DataLoad;
11

12
namespace Rdmp.Core.CommandExecution.AtomicCommands;
13

14
/// <summary>
15
/// Creates the expected and required flat file layout for a <see cref="LoadMetadata"/>
16
/// </summary>
17
public class ExecuteCommandCreateNewSplitDataLoadDirectory : BasicCommandExecution
18
{
19
    /// <summary>
20
    /// The load if any to create the folder structure for
21
    /// </summary>
22
    public LoadMetadata LoadMetadata { get; }
14✔
23

24
    /// <summary>
25
    /// The directory to create or null to do the operation
26
    /// interactively.
27
    /// </summary>
28
    public DirectoryInfo ForLoadingDir { get; }
2✔
29
    /// <summary>
30
    /// The directory to create or null to do the operation
31
    /// interactively.
32
    /// </summary>
33
    public DirectoryInfo ForArchivingDir { get; }
2✔
34
    /// <summary>
35
    /// The directory to create or null to do the operation
36
    /// interactively.
37
    /// </summary>
38
    public DirectoryInfo ExecutablesDir { get; }
2✔
39
    /// <summary>
40
    /// The directory to create or null to do the operation
41
    /// interactively.
42
    /// </summary>
43
    public DirectoryInfo CacheDir { get; }
2✔
44

45
    public ExecuteCommandCreateNewSplitDataLoadDirectory(IBasicActivateItems activator,
46
        [DemandsInitialization(
47
            "Optional load for which you are creating the folder structure.  Will have its directory locations set to the new dir if passed")]
48
        LoadMetadata load,
49
        [DemandsInitialization("The directory to create new loads in.")]
50
        DirectoryInfo forLoadingDir,
51
         [DemandsInitialization("The directory to create new archives in.")]
52
        DirectoryInfo forArchivingDir,
53
          [DemandsInitialization("The directory to create new executables in.")]
54
        DirectoryInfo executablesDir,
55
           [DemandsInitialization("The directory to create new caches in.")]
56
        DirectoryInfo cacheDir
57
        ) : base(activator)
2✔
58
    {
59
        LoadMetadata = load;
2✔
60
        ForLoadingDir = forLoadingDir;
2✔
61
        ForArchivingDir = forArchivingDir;
2✔
62
        ExecutablesDir = executablesDir;
2✔
63
        CacheDir = cacheDir;
2✔
64
    }
2✔
65

66
    public override void Execute()
67
    {
68
        base.Execute();
2✔
69

70
        var fl = ForLoadingDir;
2✔
71
        var fa = ForArchivingDir;
2✔
72
        var e = ExecutablesDir;
2✔
73
        var c = CacheDir;
2✔
74

75
        // if called with an explicit full dir then that is where we create load folders
76
        // otherwise get them to pick something that exists and then name a new folder to
77
        // create
78

79
        if (fl == null)
2!
80
        {
NEW
81
            fl = BasicActivator.SelectDirectory("Directory to load files in from");
×
82

NEW
83
            if (fl == null)
×
NEW
84
                return;
×
85

86
        }
87
        if (fa == null)
2!
88
        {
NEW
89
            fa = BasicActivator.SelectDirectory("Directory to store the archives in");
×
90

NEW
91
            if (fa == null)
×
NEW
92
                return;
×
93

94
        }
95
        if (e== null)
2!
96
        {
NEW
97
            e = BasicActivator.SelectDirectory("Directory to store executables");
×
98

NEW
99
            if (e == null)
×
NEW
100
                return;
×
101

102
        }
103
        if (c == null)
2!
104
        {
NEW
105
            c = BasicActivator.SelectDirectory("Directory to store caches");
×
106

NEW
107
            if (c == null)
×
NEW
108
                return;
×
109

110
        }
111

112
        var loadDir = new LoadDirectory(fl.FullName, fa.FullName, e.FullName, c.FullName);
2✔
113

114
        // if we have a load then update the path to this location we just created
115
        if (LoadMetadata != null)
2✔
116
        {
117
            LoadMetadata.LocationOfForLoadingDirectory = loadDir.ForLoading.FullName;
2✔
118
            LoadMetadata.LocationOfForArchivingDirectory = loadDir.ForArchiving.FullName;
2✔
119
            LoadMetadata.LocationOfExecutablesDirectory = loadDir.ExecutablesPath.FullName;
2✔
120
            LoadMetadata.LocationOfCacheDirectory = loadDir.Cache.FullName;
2✔
121
            LoadMetadata.SaveToDatabase();
2✔
122
            Publish(LoadMetadata);
2✔
123
        }
124
    }
2✔
125
}
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

© 2025 Coveralls, Inc