()
| 461 | } |
| 462 | |
| 463 | func (a *processor) Archive() error { |
| 464 | toArchive := map[string]struct{}{} |
| 465 | for _, f := range a.artifactsExtra { |
| 466 | if fsutil.Exists(f) { |
| 467 | toArchive[f] = struct{}{} |
| 468 | } |
| 469 | } |
| 470 | |
| 471 | artifacts, err := os.ReadDir(a.artifactsDirName) |
| 472 | if err != nil { |
| 473 | return err |
| 474 | } |
| 475 | |
| 476 | // We archive everything in the /opt/_slim/artifacts folder |
| 477 | // except (potentially large data) `files` and `files.tar` entries. |
| 478 | // and the monitor data event log |
| 479 | // (which is used for local debugging or it should be streamed out of band) |
| 480 | // In particular, this may include: |
| 481 | // - creport.json |
| 482 | // - events.json |
| 483 | // - app_stdout.log |
| 484 | // - app_stderr.log |
| 485 | for _, f := range artifacts { |
| 486 | if f.Name() != app.ArtifactFilesDirName && |
| 487 | f.Name() != filesArchiveName && |
| 488 | f.Name() != report.DefaultMonDelFileName { |
| 489 | toArchive[filepath.Join(a.artifactsDirName, f.Name())] = struct{}{} |
| 490 | } |
| 491 | } |
| 492 | |
| 493 | var toArchiveList []string |
| 494 | for name := range toArchive { |
| 495 | toArchiveList = append(toArchiveList, name) |
| 496 | } |
| 497 | return fsutil.ArchiveFiles( |
| 498 | filepath.Join(a.artifactsDirName, runArchiveName), toArchiveList, false, "") |
| 499 | } |
| 500 | |
| 501 | func saveResults( |
| 502 | origPathMap map[string]struct{}, |
nothing calls this directly
no test coverage detected