File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
extension/src/experiments/checkpoints Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ describe('collectHasCheckpoints', () => {
2828 expect ( hasCheckpoints ) . toBe ( true )
2929 } )
3030
31- it ( 'should correctly identify a dvc.yaml without checkpoint' , ( ) => {
31+ it ( 'should correctly classify a dvc.yaml without checkpoint' , ( ) => {
3232 const hasCheckpoints = collectHasCheckpoints ( {
3333 stages : {
3434 extract : {
@@ -51,7 +51,7 @@ describe('collectHasCheckpoints', () => {
5151 expect ( hasCheckpoints ) . toBe ( false )
5252 } )
5353
54- it ( 'should correctly identify a more complex dvc.yaml without checkpoint' , ( ) => {
54+ it ( 'should correctly classify a more complex dvc.yaml without checkpoint' , ( ) => {
5555 const hasCheckpoints = collectHasCheckpoints ( {
5656 stages : {
5757 evaluate : {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { Deferred } from '@hediet/std/synchronization'
44import { collectHasCheckpoints } from './collect'
55import { findFiles } from '../../fileSystem/workspace'
66import { isSameOrChild , loadYaml , PartialDvcYaml } from '../../fileSystem'
7- import { definedAndNonEmpty } from '../../util/array'
7+ import { definedAndNonEmpty , uniqueValues } from '../../util/array'
88
99export class ExperimentCheckpointsModel {
1010 public dispose = Disposable . fn ( )
@@ -35,8 +35,11 @@ export class ExperimentCheckpointsModel {
3535 if ( yaml ) {
3636 const hasCheckpoints = collectHasCheckpoints ( yaml )
3737
38- if ( hasCheckpoints && ! this . yamlWithCheckpoints . includes ( path ) ) {
39- this . yamlWithCheckpoints . push ( path )
38+ if ( hasCheckpoints ) {
39+ this . yamlWithCheckpoints = uniqueValues ( [
40+ ...this . yamlWithCheckpoints ,
41+ path
42+ ] )
4043 } else {
4144 this . yamlWithCheckpoints = this . yamlWithCheckpoints . filter (
4245 file => file !== path
You can’t perform that action at this time.
0 commit comments