Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use /tmp (or analog in other OSs) instead of the working "directory" #1849

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Epicea-Tests/EpTestLogBuilder.class.st
Expand Up @@ -83,7 +83,7 @@ EpTestLogBuilder >> logInitial [
{ #category : #initialization }
EpTestLogBuilder >> newDirectory [

^ ('epicea-tests-', UUID new asString36) asFileReference
^ FileReference newTempFilePrefix: 'epicea-tests-' suffix: ''
]

{ #category : #initialization }
Expand Down
47 changes: 19 additions & 28 deletions src/EpiceaBrowsers-Tests/EpOmbuExporterTest.class.st
Expand Up @@ -5,45 +5,42 @@ Class {
'outputLog',
'inputLog1',
'inputLog2',
'outputDirectory',
'logBuilder1',
'logBuilder2'
],
#category : #'EpiceaBrowsers-Tests-Exporter'
}

{ #category : #accessing }
EpOmbuExporterTest >> outputLogNameForTest [

^ self className, 'LogForTest'
]

{ #category : #running }
EpOmbuExporterTest >> setUp [
EpOmbuExporterTest >> setUp [

super setUp.

logBuilder1 := EpTestLogBuilder new.
logBuilder2 := EpTestLogBuilder new.
logBuilder2 := EpTestLogBuilder new.

"Create 2 logs in different directories"
inputLog1 := logBuilder1 oneTriggerWithFourChildrenLog.
inputLog2 := logBuilder2 oneTriggerWithOneChildLog.
outputLog := EpLog newWithStore: OmFileStore new.

outputDirectory := logBuilder2 directory.
outputLog := EpLog
newWithStore: (OmFileStore named: 'exported' inDirectory: outputDirectory)
]

{ #category : #running }
EpOmbuExporterTest >> tearDown [

logBuilder1 cleanUp.
logBuilder2 cleanUp.

(FileSystem workingDirectory / (self outputLogNameForTest, '.ombu')) ensureDelete.

super tearDown.
]

{ #category : #tests }
EpOmbuExporterTest >> testBasicExport [

| selection outputResult |

selection := inputLog1 entries.

EpOmbuExporter new
Expand Down Expand Up @@ -91,22 +88,16 @@ EpOmbuExporterTest >> testCommentExportWithDependencyFix [
{ #category : #tests }
EpOmbuExporterTest >> testRoundtrip [

| aLog anotherLog |
aLog :=
EpLog newWithStore:
(OmFileStore
named: self outputLogNameForTest
inDirectory: FileSystem workingDirectory).

| outputLogReopened |
EpOmbuExporter new
outputLog: aLog;
outputLog: outputLog;
fileOut: inputLog1 entries.

anotherLog :=
EpLog newWithStore:
(OmFileStore
named: self outputLogNameForTest
inDirectory: FileSystem workingDirectory).
"Open a fresh log with the exported entries.
(fresh, to be sure it was correctly written to disk)"
outputLogReopened := EpLog newWithStore: outputLog store flush copyReopened refresh.

self assert: anotherLog entries size equals: inputLog1 entries size.
self
assert: outputLogReopened entries size
equals: inputLog1 entries size
]
6 changes: 0 additions & 6 deletions src/Ombu-Tests/OmFileStoreTest.class.st
Expand Up @@ -4,12 +4,6 @@ Class {
#category : #'Ombu-Tests'
}

{ #category : #resources }
OmFileStoreTest >> directoryForTests [

^ FileSystem workingDirectory
]

{ #category : #resources }
OmFileStoreTest >> setUpOtherStore [

Expand Down
3 changes: 2 additions & 1 deletion src/Ombu-Tests/OmSessionStoreNameStrategyTest.class.st
Expand Up @@ -28,7 +28,7 @@ OmSessionStoreNameStrategyTest >> createFileWith: aName [
{ #category : #private }
OmSessionStoreNameStrategyTest >> directory [

^ 'ombu-strategy-tests' asFileReference
^ FileLocator temp asFileReference / 'ombu-strategy-tests'
]

{ #category : #private }
Expand All @@ -41,6 +41,7 @@ OmSessionStoreNameStrategyTest >> fileReferenceWith: aName [

{ #category : #running }
OmSessionStoreNameStrategyTest >> setUp [

super setUp.
strategy := self strategyClass new
]
Expand Down
6 changes: 0 additions & 6 deletions src/Ombu-Tests/OmSessionStoreTest.class.st
Expand Up @@ -4,12 +4,6 @@ Class {
#category : #'Ombu-Tests'
}

{ #category : #resources }
OmSessionStoreTest >> directoryForTests [

^ FileSystem workingDirectory
]

{ #category : #resources }
OmSessionStoreTest >> setUpOtherStore [

Expand Down
6 changes: 6 additions & 0 deletions src/Ombu-Tests/OmStoreTest.class.st
Expand Up @@ -26,6 +26,12 @@ OmStoreTest >> beforeAndAfterFlushStore: aBlock [
aBlock value.
]

{ #category : #resources }
OmStoreTest >> directoryForTests [

^ FileLocator temp asFileReference / 'ombu-tests'
]

{ #category : #running }
OmStoreTest >> setUp [
super setUp.
Expand Down