Question: I have the following test. If I set log ...
# atmos-dev
c
Question: I have the following test. If I set log level to debug, I get match errors from the stack trace memory addresses not matching the stderr snapshots. If I leave log level as info, then I cannot test a
log.Debug
call is executing. What is the work around to get test the log.Debug message and not error from a stack trace message in stderr snapshot?
Copy code
- name: atmos docs no component 2
    enabled: true
    snapshot: true
    description: "Ensure atmos docs command executes with error component not found."
    workdir: "fixtures/scenarios/core/"
    command: "atmos"
    args:
      - "docs"
      - "bucket6"
    expect:
      diff: []
      exit_code: 1
      stdout:
        - "no such file or directory"
      stderr:
        - "component not found"
I disabled snapshots for now
a
Copy code
log.SetLevel(log.DebugLevel)
	log.SetOutput(os.Stdout). // or Stderr
i think you need to add this
c
@Andriy Knysh (Cloud Posse) Looks like this is taken care of in config file
Copy code
logs:
  file: "/dev/stdout"
  level: Info
The issue I am seeing is that when we run log level debug, we output the error stack trace and this contains memory addresses that no do match between snapshot runs
I just did the following to resolve the issue for now
Copy code
- name: atmos docs no component 1
    enabled: true
    snapshot: false
👍 1
@Andriy Knysh (Cloud Posse) - I pushed tests and it seems like codecov is not recognizing the new tests
Copy code
Check warning on line 78 in cmd/docs.go


Codecov
/ codecov/patch
cmd/docs.go#L78

Added line #L78 was not covered by tests
a
codecov does not know about the acceptance tests (where you execute Atmos CLI commands). we add two type of tests: acceptance and unit (Go code), which codecov recognizes)
c
So I will also need to add go test files for things
ok
So I am making the incorrect type of acceptance tests for somethings
I will adjust my approach
a
acceptance tests are good and important - they test an Atmos command as if people were calling it
we ussually add both types of tests (yes, it takes time and patient 🙂 )