Skip to content

Commit

Permalink
Remove tests for if the version constant is up to date or not
Browse files Browse the repository at this point in the history
This was useful way back when when we used a manual versioning system and this could catch cases where I messed up, but now that versioning is automated this is not needed.
  • Loading branch information
caendesilva committed Jun 28, 2024
1 parent 333d507 commit fd1e7e6
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions packages/framework/tests/Feature/HydeKernelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

namespace Hyde\Framework\Testing\Feature;

use Throwable;
use Hyde\Enums\Feature;
use Composer\InstalledVersions;
use Hyde\Facades\Features;
use Hyde\Foundation\Facades\Pages;
use Hyde\Foundation\Facades\Routes;
Expand Down Expand Up @@ -306,34 +304,6 @@ public function testVersionConstantIsAValidSemverString()
);
}

public function testVersionConstantIsUpToDateWithComposer()
{
$version = InstalledVersions::getPrettyVersion('hyde/framework');

if (str_starts_with($version, 'dev-')) {
$this->markTestSkipped('Installed version is for development');
}

$this->assertSame(HydeKernel::VERSION, $version);
}

public function testVersionConstantIsUpToDateWithGit()
{
try {
$version = trim(shell_exec('git describe --abbrev=0 --tags'));
} catch (Throwable) {
// Gracefully skip the test if the version cannot be fetched
$this->markTestSkipped('Could not get version from Git');
}

if ('v'.HydeKernel::VERSION === $version) {
$this->assertSame('v'.HydeKernel::VERSION, $version);
} else {
// Gracefully skip the test if the version is not up-to-date
$this->markTestSkipped('Version constant does not match Git version!');
}
}

public function testVersionMethodReturnsVersionConstant()
{
$this->assertSame(HydeKernel::VERSION, Hyde::version());
Expand Down

0 comments on commit fd1e7e6

Please sign in to comment.