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

Freegle / Iznik / 11352

08 May 2026 03:46PM UTC coverage: 72.847% (+0.07%) from 72.775%
11352

push

circleci

CircleCI Auto-merge
Auto-merge master to production - fix(batch): update dry-run tests to match new pass-through architecture

13783 of 20750 branches covered (66.42%)

Branch coverage included in aggregate %.

937 of 1135 new or added lines in 35 files covered. (82.56%)

18 existing lines in 5 files now uncovered.

101757 of 137857 relevant lines covered (73.81%)

22.47 hits per line

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

80.95
/iznik-batch/app/Console/Commands/Integrations/SyncLoveJunkCommand.php
1
<?php
2

3
namespace App\Console\Commands\Integrations;
4

5
use App\Console\Concerns\PreventsOverlapping;
6
use App\Services\LoveJunkService;
7
use Illuminate\Console\Command;
8
use Illuminate\Support\Facades\Log;
9
use App\Traits\GracefulShutdown;
10

11
class SyncLoveJunkCommand extends Command
12
{
13
    use PreventsOverlapping;
14
    use GracefulShutdown;
15

16
    protected $signature = 'integrations:sync-lovejunk
17
                            {--dry-run : Show what would be synced without making changes}';
18

19
    protected $description = 'Sync Freegle offer messages with LoveJunk API';
20

21
    public function handle(LoveJunkService $service): int
1✔
22
    {
23
        if (!$this->acquireLock()) {
1✔
24
            $this->info('Already running, exiting.');
×
25
            return Command::SUCCESS;
×
26
        }
27

28
        try {
29
            $dryRun = (bool) $this->option('dry-run');
1✔
30

31
            if ($dryRun) {
1✔
32
                $this->info('Dry run — counting work but not calling LoveJunk API or writing.');
1✔
33
            } else {
NEW
34
                Log::info('LoveJunk: Starting sync');
×
35
            }
36

37
            $result = $service->sync($dryRun);
1✔
38

39
            $verb = $dryRun ? 'Would' : '';
1✔
40
            $this->info(sprintf(
1✔
41
                '%sSent: %d, %sEdited: %d, %sCompleted/Deleted: %d, Failed: %d',
1✔
42
                $verb, $result['sent'],
1✔
43
                $verb, $result['edited'],
1✔
44
                $verb, $result['completed_or_deleted'],
1✔
45
                $result['failed']
1✔
46
            ));
1✔
47

48
            if (!$dryRun) {
1✔
NEW
49
                Log::info('LoveJunk: Done', $result);
×
50
            }
51

52
            return Command::SUCCESS;
1✔
53
        } finally {
54
            $this->releaseLock();
1✔
55
        }
56
    }
57
}
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