Skip to content

Commit

Permalink
removed dynamic output path
Browse files Browse the repository at this point in the history
  • Loading branch information
mbto committed Jul 15, 2021
1 parent 0a7eb16 commit a9b836e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
(Example: If MySQL server `max_allowed_packet` parameter is too small - [64 MB by default](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_max_allowed_packet))
* Appends emoji country flags 🇦🇩 🇦🇪 🇦🇫 🇦🇬 🇦🇮 🇦🇱 🇦🇲 🇦🇴 🇦🇶 🇦🇷 🇦🇸 🇦🇹 🇦🇺 🇦🇼 🇦🇽 🇦🇿 🇧🇦 🇧🇧 🇧🇩 🇧🇪 🇧🇫 🇧🇬 🇧🇭 🇧🇮 🇧🇯 🇧🇱 🇧🇲 🇧🇳 🇧🇴 🇧🇶 🇧🇷 🇧🇸 🇧🇹 🇧🇻 🇧🇼 🇧🇾...
* Supports MaxMind edition IDs: `GeoLite2-Country-CSV, GeoLite2-City-CSV`; `IPv4, IPv6`; Locations locale codes: `en, ru, de, es, fr, ja, pt-BR, zh-CN`
* Provides configuration files and template engine syntax for build DDL/DML for MySQL/PostgreSQL/Microsoft SQL Server 2019/your custom. For custom DBMS, you can write a template yourself.
* Provides [template-ready configuration files](https://github.com/mbto/maxmind-geoip2-csv2sql-converter/tree/master/src/main/resources) for `MySQL 8/PostgreSQL 13/Microsoft SQL Server 2019` and template engine with simple syntax for build DDL/DML. For custom DBMS, you can write a template yourself.
* Win/Unix distribution

#### Requirements:
Expand All @@ -24,6 +24,6 @@
* Requirements:
* Gradle 5.4+
* With tests:
* gradle build
* gradlew.bat build
* Without tests:
* gradle build -x test
* gradlew.bat build -x test
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ public void allocateRegistrySettings() {
}

public void allocateScriptsPath() throws IOException {
String archiveNameWithoutDot = archivePath.getFileName().toString();
int dot = archiveNameWithoutDot.lastIndexOf('.');
archiveNameWithoutDot = dot > -1 ? archiveNameWithoutDot.substring(0, dot) : archiveNameWithoutDot;
scriptsPath = args.getOutputDirPath().resolve(archiveNameWithoutDot);
if (Files.notExists(scriptsPath))
// String archiveNameWithoutDot = archivePath.getFileName().toString();
// int dot = archiveNameWithoutDot.lastIndexOf('.');
// archiveNameWithoutDot = dot > -1 ? archiveNameWithoutDot.substring(0, dot) : archiveNameWithoutDot;
scriptsPath = args.getOutputDirPath();//.resolve(archiveNameWithoutDot);
if (!Files.isDirectory(scriptsPath))
Files.createDirectories(scriptsPath);
System.out.println("Resolved scripts path '" + scriptsPath + "'");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ static String buildIntegrationOutputDirPath(String testId) {
return testId.isEmpty() ? integrationTestsDirPath.toString() : integrationTestsDirPath.resolve(testId).toString();
}

static Path buildFullArchivePath(String editionId, String testId) {
static Path buildFullArchivePath(String testId) {
return integrationTestsDirPath
.resolve(testId)
.resolve(editionId + "_" + archiveDate)
.resolve(resultArchiveName);
}

Expand Down Expand Up @@ -94,7 +93,7 @@ static void assertStats(String[] argsRaw, String editionId, String testId,
t = e;
}

Path fullArchivePath = buildFullArchivePath(editionId, testId);
Path fullArchivePath = buildFullArchivePath(testId);
Assert.assertTrue("Path '" + fullArchivePath + "' not a file", Files.exists(fullArchivePath) && Files.isRegularFile(fullArchivePath));

long actualArchiveFileSize = Files.size(fullArchivePath);
Expand All @@ -109,8 +108,8 @@ static void assertStats(String[] argsRaw, String editionId, String testId,
"),\n\t\t\t\t\t\t" + actualArchiveFileSize + "},")));
}
if (delete) {
// Deleting testId direcroty from: R:\IntegrationTests\SOFTWARE_NAME\testId\editionId + archiveDate\resultArchiveName
deleteRecursive(fullArchivePath.getParent().getParent());
// Deleting testId direcroty from: R:\IntegrationTests\SOFTWARE_NAME\testId\resultArchiveName
deleteRecursive(fullArchivePath.getParent());
}
Assert.assertNull(t);
Assert.assertNotNull(application);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public void manualBuild1() throws Throwable {
// args.setApiURI();
args.setDeleteCSVs(false);
args.setDeleteScripts(false);
// args.setDeleteCSVs(true);
// args.setDeleteScripts(true);
registry.allocateRegistrySettings();
args.setSourceArchiveURI(resourceTestsDirPath.resolve(buildArchiveName(registry.getEditionId())).toString());

Expand Down

0 comments on commit a9b836e

Please sign in to comment.